#C9611. Avoid Increasing Subsequences of Length Four

    ID: 53724 Type: Default 1000ms 256MiB

Avoid Increasing Subsequences of Length Four

Avoid Increasing Subsequences of Length Four

You are given an integer n and you need to output a permutation of the integers from 1 to n such that the permutation does not contain any increasing subsequence of length 4 or more. A simple observation is that if you output the numbers in strictly descending order, any increasing subsequence can be of length at most 1. More formally, you need to generate a permutation \(a_1,a_2,\ldots,a_n\) of \(\{1,2,\ldots,n\}\) such that there does not exist indices \(i_1 < i_2 < i_3 < i_4\) with \(a_{i_1} < a_{i_2} < a_{i_3} < a_{i_4}\).

For example, if n = 5, one valid answer is:

[ 5 \quad 4 \quad 3 \quad 2 \quad 1 ]

This descending order permutation meets the requirements.

inputFormat

The first line of input contains a single integer t (\(1 \le t \le 100\)), representing the number of test cases.

Each of the next t lines contains a single integer n (\(1 \le n \le 10^5\)), the number of elements in the permutation.

Input is given via standard input (stdin).

outputFormat

For each test case, output a single line with n integers: a permutation of the numbers from 1 to n which does not contain any increasing subsequence of length 4 or more. The numbers should be separated by a single space and the output should be sent to standard output (stdout).

## sample
1
5
5 4 3 2 1

</p>