题目描述
Given an even integer N, output a permutation P of length N, such that:
The value of P_{i} + P_{N+1-i} is distinct for all 1 ≤ i ≤ $\frac{N}{2}$.
It is guaranteed that a possible solution always exists. If multiple such permutations exist, print any.
Note that, a permutation P of length N, consists of all integers from 1 to N exactly once. For example, [2, 1, 3, 4] is a permutation, while [2, 2, 1, 3] is not.
------ Input Format ------
- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of a single line containing a single even integer N.
------ Output Format ------
For each test case, output N space-separated integers, denoting the permutation P of length N.
------ Constraints ------
$1 ≤ T ≤ 1000$
$2 ≤ N ≤ 2000$
$N$ is even.
----- Sample Input 1 ------
3
2
6
4
----- Sample Output 1 ------
2 1
1 3 2 4 5 6
2 1 3 4
----- explanation 1 ------
Test case $1$: Consider the permutation $P = [2, 1]$.
The value $P_{i} + P_{N+1-i} = 2 + 1 = 3$ for $i = 1$, which is distinct.
Test case $2$: Consider the permutation $P = [1, 3, 2, 4, 5, 6]$.
- For $i = 1$: The value $P_{i} + P_{N+1-i} = 1 + 6 = 7$.
- For $i = 2$: The value $P_{i} + P_{N+1-i} = 3 + 5 = 8$.
- For $i = 3$: The value $P_{i} + P_{N+1-i} = 2 + 4 = 6$.
Thus, the values are distinct for each $1 ≤ i ≤ \frac{N}{2}$.
Test case $3$: Consider the permutation $P = [2, 1, 3, 4]$.
- For $i = 1$: The value $P_{i} + P_{N+1-i} = 2 + 4 = 6$.
- For $i = 2$: The value $P_{i} + P_{N+1-i} = 1 + 3 = 4$.
Thus, the values are distinct for each $1 ≤ i ≤ \frac{N}{2}$.
输入格式
见题面
输出格式
见题面