{"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":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003e弑君者再也受不了了!!!每次4-4的作战,都要被阿消和暗锁来回摩擦。但刀客塔不会放过她的,毕竟迫害弑君者那么有意思,还能拿到作战奖励扭转醇来精二自己的干员。现在刀客塔手里有n个字符串,其中每有一个回文串都能迫害一次弑君者。\u003c/p\u003e\n\u003cp\u003e回文串是指一个字符串t从前往后读取或从后往前读取均相同的字符串(对于任意i∈[0,|t|),t[i] \u003d t[|t|-i])。例如:010,1001,0都是回文串。\u003c/p\u003e\n\u003cp\u003e刀客塔拥有n个二进制字符串s1,s2,……,sn(si都由0或1组成)。刀客塔可以任意次交换一对字符。这对字符可以来自相同的字符串,也可以来自不同的字符串——没有限制。即可以无限次完成以下任务:\u003c/p\u003e\n\u003cul\u003e \n \u003cli\u003e选择四个整数x,a,y,b使1 \u003c\u003d x,y \u003c\u003d n和0 \u003c\u003d a \u003c |sx|,0 \u003c\u003db \u003c |sy|(其中x和y是第x和第y个字符串,而a,b分别是字符串sx和sy中的位置)\u003c/li\u003e\n \u003cli\u003e交换字符sx[a]和sy[b].\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e刀客塔已经没有理智了,所以请你帮他算一下他最多能迫害几次弑君者。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含单个整数Q(1 \u003c\u003d Q \u003c\u003d 50)——测试样例的数量。\u003c/p\u003e\n\u003cp\u003e每组测试样例的第一行包含单个整数n(1 \u003c\u003d n \u003c\u003d 50)——刀客塔拥有的二进制字符串数。\u003c/p\u003e\n\u003cp\u003e接下来的n行二进制字符串s1,s2,……,sn——每行一个,保证1 \u003c\u003d |si| \u003c\u003d 50,并且所有字符串都只会含有0或1。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出Q个整数——每个测试样例一个,第i个整数应该是你可以同时在第i个样例中给定的n个字符串中执行零次或多次交换的所达成的回文串的最大数量——也就是刀客塔能迫害弑君者的最大次数。\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cb\u003e\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4\n1\n0\n3\n1110\n100110\n010101\n2\n11111\n000001\n2\n001\n11100111\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1\n2\n2\n2\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e\u003c/b\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e在第一个样例中,s1是回文串,所以刀客塔能迫害1次弑君者。\u003c/p\u003e\n\u003cp\u003e在第二个样例中,你不能同时使所有字符串都变为回文串,但是你可以获得两个回文串。例如:让s1 \u003d 0110,s2 \u003d 111111和s3 \u003d 010000。\u003c/p\u003e\n\u003cp\u003e在第三个样例中,我们可以使两个字符串都变成回文串。例如,s1 \u003d 11011和s2 \u003d 100001。\u003c/p\u003e\n\u003cp\u003e在最后一个测试样例中,s2已经是回文。你可以通过交换s1[1]和s1[2]来使s1也回文。\u003c/p\u003e"}}]}