## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Divisible by i CodeChef Solution | CodeChef Problem Solution 2022

You are given an integer $N$.

Construct a permutation $P$ of length $N$ such that

• For all $i$ $\left(1\le i\le N-1\right)$$i$ divides $abs\left({P}_{i+1}-{P}_{i}\right)$.

Recall that a permutation of length $N$ is an array where every integer from $1$ to $N$ occurs exactly once.

It can be proven that for the given constraints at least one such $P$ always exists.

### Input Format

• The first line of input contains a single integer $T$, denoting the number of test cases. The

•  description of $T$ test cases follow.
• The only line of each test case contains an integer $N$ - the length of the array to be constructed.

### Output Format

For each test case, output a single line containing $N$ space-separated integers ${P}_{1},{P}_{2},\dots ,{P}_{N}$, denoting the elements of the array $P$.

If there exist multiple such arrays, print any.

### Constraints

• $1\le T\le 5\cdot {10}^{4}$
• $2\le N\le {10}^{5}$
• The sum of $N$ over all test cases does not exceed