{"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\u003eYou are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears:\u003c/p\u003e\u003col\u003e \u003cli\u003e Choose the maximum by length subarray (\u003cspan class\u003d\"tex-font-style-bf\"\u003econtinuous subsegment\u003c/span\u003e) consisting \u003cspan class\u003d\"tex-font-style-bf\"\u003eonly\u003c/span\u003e of zeros, among all such segments choose the \u003cspan class\u003d\"tex-font-style-bf\"\u003eleftmost\u003c/span\u003e one; \u003c/li\u003e\u003cli\u003e Let this segment be $$$[l; r]$$$. If $$$r-l+1$$$ is odd (not divisible by $$$2$$$) then assign (set) $$$a[\\frac{l+r}{2}] :\u003d i$$$ (where $$$i$$$ is the number of the current action), otherwise (if $$$r-l+1$$$ is even) assign (set) $$$a[\\frac{l+r-1}{2}] :\u003d i$$$. \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eConsider the array $$$a$$$ of length $$$5$$$ (initially $$$a\u003d[0, 0, 0, 0, 0]$$$). Then it changes as follows:\u003c/p\u003e\u003col\u003e \u003cli\u003e Firstly, we choose the segment $$$[1; 5]$$$ and assign $$$a[3] :\u003d 1$$$, so $$$a$$$ becomes $$$[0, 0, 1, 0, 0]$$$; \u003c/li\u003e\u003cli\u003e then we choose the segment $$$[1; 2]$$$ and assign $$$a[1] :\u003d 2$$$, so $$$a$$$ becomes $$$[2, 0, 1, 0, 0]$$$; \u003c/li\u003e\u003cli\u003e then we choose the segment $$$[4; 5]$$$ and assign $$$a[4] :\u003d 3$$$, so $$$a$$$ becomes $$$[2, 0, 1, 3, 0]$$$; \u003c/li\u003e\u003cli\u003e then we choose the segment $$$[2; 2]$$$ and assign $$$a[2] :\u003d 4$$$, so $$$a$$$ becomes $$$[2, 4, 1, 3, 0]$$$; \u003c/li\u003e\u003cli\u003e and at last we choose the segment $$$[5; 5]$$$ and assign $$$a[5] :\u003d 5$$$, so $$$a$$$ becomes $$$[2, 4, 1, 3, 5]$$$. \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eYour task is to find the array $$$a$$$ of length $$$n$$$ after performing all $$$n$$$ actions. \u003cspan class\u003d\"tex-font-style-bf\"\u003eNote that the answer exists and unique\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eYou have to answer $$$t$$$ independent test cases.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one integer $$$t$$$ ($$$1 \\le t \\le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eThe only line of the test case contains one integer $$$n$$$ ($$$1 \\le n \\le 2 \\cdot 10^5$$$) — the length of $$$a$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \\cdot 10^5$$$ ($$$\\sum n \\le 2 \\cdot 10^5$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. \u003cspan class\u003d\"tex-font-style-bf\"\u003eNote that the answer exists and unique\u003c/span\u003e.\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\n1\n2\n3\n4\n5\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}