| Baozii Cup 2 |
|---|
| Finished |
You are given a positive integer $$$n$$$. Construct a permutation $$$p$$$ of $$$\{1,2,\ldots,n\}$$$ such that the length of the longest increasing subsequence of $$$p$$$ is equal to the length of the longest decreasing subsequence of $$$p$$$.
An increasing (decreasing) subsequence of an array $$$a$$$ of length $$$n$$$ is defined as an array $$$b$$$ such that:
Each test contains multiple test cases. The first line of each test contains an integer $$$t$$$ ($$$1 \le t \le 5 \cdot 10^4$$$) — the number of test cases.
The only line of each test case contains an integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$p$$$ to be constructed.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, if no solution exists, output $$$-1$$$ on a single line.
Otherwise, output $$$n$$$ distinct integers $$$p_1,p_2,\ldots,p_n$$$ ($$$1 \le p_i \le n$$$) on a single line — the permutation $$$p$$$ you constructed.
If multiple solutions exist, you may output any of them.
13
3 1 2
| Name |
|---|


