#K41862. Palindromic Array Generation
Palindromic Array Generation
Palindromic Array Generation
In this problem, you are given an integer N for each test case and you are required to generate a palindromic array of length 2N. The palindromic array is constructed by taking the sequence of integers from 1 to N and then appending its reverse. In other words, if the first half of the array is [1, 2, \dots, N], the complete array will be [1, 2, \dots, N, N, \dots, 2, 1].
Note: The length of the array is \(2N\). The problem is straightforward but requires careful input/output handling. The arrays should be printed on separate lines, with each number separated by a space.
inputFormat
The input consists of multiple test cases. The first line contains a single integer T denoting the number of test cases. Each of the following T lines contains a single integer N.
\(1 \leq T \leq 1000\) and \(1 \leq N \leq 10^5\) (constraints may vary based on the intended difficulty).
outputFormat
For each test case, output a single line containing the palindromic array of length 2N. The numbers in the array should be space-separated.
## sample1
1
1 1
</p>