

There may be more than one Langford pair possible, you need to return anyone permutation.
For N = 4, one possible Langford pairing will be:-

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 only line of each test case or query contains the integer N.
The only line of output contains “Valid” if the answer is correct and “Invalid” if it’s not, without quotes.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 5
0 <= N <= 32
Time Limit: 1 sec
It can be observed with some examples that for any number N, the permutation following Langford pairing is possible only if either N mod 4 is 0 or 3. Thus, Langford pairing is possible for 3, 4, 7, 8, etc, and not possible for 1, 2, 5, 6, etc. Now to find the sequence,
bool langfordPairing(result, N):