1. 1 occurs in the sequence exactly once.
2. Each integer between 2 to N(inclusive) occurs in the sequence exactly twice.
3. For each integer i between 2 to N, the distance between the two occurrences of i should be exactly i.
1. A sequence A is lexicographically larger than a sequence B (of the same length), if in the first position where A and B differ, sequence A has a number greater than the corresponding number in B.
2. It is guaranteed that under the given constraints, there is always a solution.
The first line contains an integer, ‘T’ which denotes the number of test cases or queries to be run. Then, the T test cases follow.
The first and the only line of each test case contains one integer N, as described in the problem statement.
For each test case, print in a new line, 2*'N' - 1 space-separated integer representing the lexicographically largest sequence for the given input.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 20
Time Limit: 1 second
Prime Digit Sum
Prime Digit Sum
Mario And His Princess
Combination Sum III
Combination Sum III
Combination Sum III
Generate All Strings
8-Queen Problem