| 2022 SYSU School Contest |
|---|
| Finished |
Sunset Shimmer defines the value of a permutation $$$p$$$ of length $$$n$$$ is $$$\sum_{i=1}^np_i\oplus i$$$, the $$$\oplus$$$ represents bitwise XOR.
Now she wants to know the maximal value of permutation of lenght $$$n$$$.
The first line contains a single integer $$$T\ (1\le T\le 10^5)$$$ - the number of testcases.
Each testcase contains a single integer $$$n(1\le \sum n\le 10^5)$$$ - the length of the permutation.
For each testcase, print one line of $$$n$$$ integers , represents the maximal value permutation of length $$$n$$$.
If there are multiple solutions, just output any of them.
2 3 5
3 1 2 5 1 4 3 2
| Name |
|---|


