Average Permutation#11685

Average Permutation

1 second
128 megabytes
Medium

Find a permutation P = [p_1, p_2, \ldots, p_n] of the integers \{1, 2, \ldots, n\} such that sum of averages of all consecutive triplets is minimized, i.e.

\sum_{i = 1}^{n - 2} \frac{p_i + p_{i + 1} + p_{i + 2}}{3}

is minimized.

If multiple permutations are possible, print any of them.

Input

The first line contains the number of test cases t~(t \le 1000).

The first and only line of each test case contains an integer n~(3 \le n \le 10^5), the size of the permutation.

Output

For each test case, print on a new line any permutation which satisfies the above conditions.

Examples

The first test case. Among all possible permutations \{3, 2, 1, 4\} is one which provides the minimum result:

\frac{3 + 2 + 1}{3} + \frac{2 + 1 + 4}{3} = \frac{6}{3} + \frac{7}{3} = \frac{13}{3} = 4.3333\ldots

The second test case. Every permutation of size will have the same value:

\frac{3 + 2 + 1}{3} = \frac{6}{3} = 2

Example 1

Loading
Loading