#C10127. Water Balloon Throw Sequence

    ID: 39298 Type: Default 1000ms 256MiB

Water Balloon Throw Sequence

Water Balloon Throw Sequence

In this problem, n players are arranged uniformly in a circle and numbered from 1 to n. Each player throws a water balloon to the player directly opposite. Mathematically, for an even number n, the ball thrown by player i (with 1 ≤ i ≤ \(\frac{n}{2}\)) goes to player i + \(\frac{n}{2}\).

Your task is to compute the sequence of throw pairs for each test case. For every test case, print a single line containing the sequence. Each pair is printed as two numbers separated by a space, and the pairs are concatenated with a single space between them.

Examples:

  • For n = 4, the sequence is: 1 3 2 4
  • For n = 6, the sequence is: 1 4 2 5 3 6
  • For n = 8, the sequence is: 1 5 2 6 3 7 4 8

inputFormat

The input is read from stdin and has the following format:

T
n1
n2
...
nT

Here, T is the number of test cases, and each ni is an even integer representing the number of players in the i-th test case. Note that n is guaranteed to be even.

outputFormat

For each test case, print one line on stdout containing the sequence of throw pairs. Each pair is printed as 'a b' (without quotes) where a is the thrower and b is the target. The pairs must be printed in order, separated by a single space.

For example, for n = 4, the output should be:

1 3 2 4
## sample
1
4
1 3 2 4

</p>