#P1352G. Special Permutation
Special Permutation
Description
A permutation of length is an array , which contains every integer from to (inclusive) and, moreover, each number appears exactly once. For example, is a permutation of length .
For a given number (), find a permutation in which absolute difference (that is, the absolute value of difference) of any two neighboring (adjacent) elements is between and , inclusive. Formally, find such permutation that for each ().
Print any such permutation for the given integer or determine that it does not exist.
The first line contains an integer () — the number of test cases in the input. Then test cases follow.
Each test case is described by a single line containing an integer ().
Print lines. Print a permutation that meets the given requirements. If there are several such permutations, then print any of them. If no such permutation exists, print -1.
Input
The first line contains an integer () — the number of test cases in the input. Then test cases follow.
Each test case is described by a single line containing an integer ().
Output
Print lines. Print a permutation that meets the given requirements. If there are several such permutations, then print any of them. If no such permutation exists, print -1.