{"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":"\u003cp\u003e\n There is an array \u003cb\u003ea\u003c/b\u003e of size \u003cb\u003en\u003c/b\u003e consiting of all zeros. You have to perform \u003cb\u003en\u003c/b\u003e operations on this array. On the \u003cb\u003ei\u003csub\u003eth\u003c/sub\u003e\u003c/b\u003e operation, you need to perform the following steps:\n \u003col\u003e\n \u003cli\u003eChoose the maximum size subarray consisting of all zeros. If there are multiple such subarrays of the same size, select the leftmost one.\u003c/li\u003e\n\n \u003cli\u003eLet the subarray be \u003cb\u003e[l,r]\u003c/b\u003e. If the length of the subarray is and odd number, then perform \u003cbr\u003e \u003cb\u003ea[(l + r) / 2] \u003d i\u003c/b\u003e [that is assign the value \u003cb\u003ei\u003c/b\u003e to the \u003cb\u003e\u003ci\u003e((l + r) / 2)\u003csub\u003eth\u003c/sub\u003e\u003c/i\u003e\u003c/b\u003e index of the array], otherwise perform \u003cb\u003ea[(l + r - 1) / 2] \u003d i\u003c/b\u003e [that is assign the value \u003cb\u003ei\u003c/b\u003e to the \u003cb\u003e\u003ci\u003e((l + r - 1) / 2)\u003csub\u003eth\u003c/sub\u003e\u003c/i\u003e\u003c/b\u003e index of the array]\u003c/li\u003e\n \u003c/ol\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n For example, let the initial array \u003cb\u003ea\u003c/b\u003e be of length 5 (a \u003d [0, 0, 0, 0, 0]). Then the operations are\n \u003col\u003e\n \u003cli\u003eThe chosen subarray is \u003cb\u003e[1, 5]\u003c/b\u003e and we assign \u003cb\u003ea[3] \u003d 1\u003c/b\u003e. The array becomes [0, 0, 1, 0, 0]\u003c/li\u003e\n\n \u003cli\u003eThe chosen subarray is \u003cb\u003e[1, 2]\u003c/b\u003e and we assign \u003cb\u003ea[1] \u003d 2\u003c/b\u003e. The array becomes [2, 0, 1, 0, 0]\u003c/li\u003e\n\n \u003cli\u003eThe chosen subarray is \u003cb\u003e[4, 5]\u003c/b\u003e and we assign \u003cb\u003ea[4] \u003d 3\u003c/b\u003e. The array becomes [2, 0, 1, 3, 0]\u003c/li\u003e\n\n \u003cli\u003eThe chosen subarray is \u003cb\u003e[2, 2]\u003c/b\u003e and we assign \u003cb\u003ea[2] \u003d 4\u003c/b\u003e. The array becomes [2, 4, 1, 3, 0]\u003c/li\u003e\n\n \u003cli\u003eThe chosen subarray is \u003cb\u003e[5, 5]\u003c/b\u003e and we assign \u003cb\u003ea[5] \u003d 5\u003c/b\u003e. The array becomes [2, 4, 1, 3, 5]\u003c/li\u003e\n \u003c/ol\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n Your task is to find the final array after all \u003cb\u003en\u003c/b\u003e operations. It is guaranteed that the answer always exists and is unique.\n\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\n The first line of the input contains an integer \u003cb\u003et (1 \u0026le; t \u0026le; 10\u003csup\u003e4\u003c/sup\u003e)\u003c/b\u003e — the number of test cases. Then \u003cb\u003et\u003c/b\u003e test cases follow.\n\u003c/p\u003e\n\n\u003cp\u003e\n Each test case contains only one line containing one integer \u003cb\u003en (1 \u0026le; n \u0026le; 2 \u0026times; 10\u003csup\u003e5\u003c/sup\u003e)\u003c/b\u003e — the length of the array \u003cb\u003ea\u003c/b\u003e.\n\u003c/p\u003e\n\n\u003cp\u003e\n It is guaranteed that the sum of \u003cb\u003en\u003c/b\u003e over all test cases does not exceed \u003cb\u003e2 \u0026times; 10\u003csup\u003e5\u003c/sup\u003e (\u0026sum;n \u0026le; 2 \u0026times; 10\u003csup\u003e5\u003c/sup\u003e)\u003c/b\u003e\n\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\n For each test case, print the final array after performing all the \u003cb\u003en\u003c/b\u003e operations.\n\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"6\u003cbr\u003e\n1\u003cbr\u003e\n2\u003cbr\u003e\n3\u003cbr\u003e\n4\u003cbr\u003e\n5\u003cbr\u003e\n6\u003cbr\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"1 \u003cbr\u003e\n1 2 \u003cbr\u003e\n2 1 3 \u003cbr\u003e\n3 1 2 4 \u003cbr\u003e\n2 4 1 3 5 \u003cbr\u003e\n3 4 1 5 2 6 \u003cbr\u003e"}}]}