{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eConsider an undirected graph $$$G$$$ with $$$n$$$ vertices. There is a value $$$a_i$$$ in each vertex.\u003c/p\u003e\u003cp\u003eTwo vertices $$$i$$$ and $$$j$$$ are connected with an edge if and only if $$$gcd(a_i, a_j) \u0026gt; 1$$$, where $$$gcd(x, y)$$$ denotes the \u003ca href\u003d\"https://en.wikipedia.org/wiki/Greatest_common_divisor\"\u003egreatest common divisor (GCD)\u003c/a\u003e of integers $$$x$$$ and $$$y$$$.\u003c/p\u003e\u003cp\u003eConsider a set of vertices. Let\u0027s call a vertex in this set \u003cspan class\u003d\"tex-font-style-it\"\u003efair\u003c/span\u003e if it is connected with an edge with all other vertices in this set.\u003c/p\u003e\u003cp\u003eYou need to find a set of $$$k$$$ vertices (where $$$k$$$ is a given integer, $$$2 \\cdot k \\le n$$$) where all vertices are fair or all vertices are not fair. One can show that such a set always exists.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains integers $$$n$$$ and $$$k$$$ ($$$6 \\leq 2 \\cdot k \\leq n \\leq 10^5$$$)\u0026nbsp;— the number of vertices and parameter $$$k$$$.\u003c/p\u003e\u003cp\u003eThe second line contains $$$n$$$ integers $$$a_1, a_2, \\ldots, a_n$$$ ($$$2 \\le a_i \\le 10^7$$$)\u0026nbsp;— the values in the vertices.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint exactly $$$k$$$ distinct integers\u0026nbsp;— the indices of the vertices in the chosen set in any order.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 3\n6 15 10 8 14 12\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 3 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e8 4\n11 15 10 6 21 15 10 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e10 5\n3003 17017 3230 49742 546 41990 17765 570 21945 36465\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4 6 9 10 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, set $$$\\{2, 4, 5\\}$$$ is an example of set where no vertices are \u003cspan class\u003d\"tex-font-style-it\"\u003efair\u003c/span\u003e. The vertex $$$2$$$ does not share an edge with vertex $$$4$$$ since $$$gcd(15, 8) \u003d 1$$$. The vertex $$$4$$$ does not share an edge with vertex $$$2$$$. The vertex $$$5$$$ does not share an edge with vertex $$$2$$$.\u003c/p\u003e\u003cp\u003eIn the second test case, set $$$\\{8, 5, 6, 4\\}$$$ is an example of a set where all vertices are \u003cspan class\u003d\"tex-font-style-it\"\u003efair\u003c/span\u003e.\u003c/p\u003e"}}]}