{"trustable":false,"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":"Description","value":{"format":"MD","content":"现在老师傅有许多不同型号的零件,每个型号的零件使用不同字母表示。老师傅现在把每个零件排成一排放在一起,并由$1$到$n$标号。\n老师傅对你说,他现在想要替换这一批零件,但是有一个替换规则:\n每一次替换时,你需要给老师傅一个数字$a$,标号不能整除$a$的零件全部被替换。\n你进行替换的次数越少,老师傅给的奖励就越高。\n请你编写程序输出替换次数最少的数字序列。"}},{"title":"Input","value":{"format":"MD","content":"第一行输入一个$T$,代表$T$个测试样例。$(1 \\le t \\le 10^4)$\n接下来每组测试样例中,第一行输入一个整数$n$和一个字符$c$,分别代表老师傅每一批次的零件数量和最终要替换的零件。$(3 \\le n \\le 3⋅10^5)$\n第二场输入一个字符串,每一位代表每个零件的型号。\n所有样例的$n$之和不超过$3e5$。"}},{"title":"Output","value":{"format":"MD","content":"对于每个测试样例输出两行,第一行输出一个整数$m$,代表需要$m$次替换,若$m$不为0,第二行输出$m$个整数,代表每次替换时给出的整数$a$。\n若答案不唯一,输出任意满足条件的答案即可。"}},{"title":"Example","value":{"format":"MD","content":"输入样例\n```\n3\n4 c\ncccc\n4 e\nbeee\n4 b\nbzyx\n```\n输出样例\n```\n0\n1\n2\n2 \n2 3\n```"}},{"title":"Note","value":{"format":"MD","content":"第三个样例中,首先替换不能被$2$整除的零件,被替换为$bzbx$,随后替换不能被$3$整除的零件,变为$bbbb$。"}}]}