Matching Numbers

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You are given an integer nn. Pair the integers 11 to 2n2n (i.e. each integer should be in exactly one pair) so that each sum of matched pairs is consecutive and distinct.

Formally, let (a_i,b_i)(a\_i, b\_i) be the pairs that you matched. a_1,b_1,a_2,b_2,,a_n,b_n\\{a\_1, b\_1, a\_2, b\_2, \ldots, a\_n, b\_n\\} should be a permutation of 1,2,,2n\\{1, 2, \ldots, 2n\\}. Let the sorted list of a_1+b_1,a_2+b_2,,a_n+b_n\\{a\_1+b\_1, a\_2+b\_2, \ldots, a\_n+b\_n\\} be s_1<s_2<<s_ns\_1 < s\_2 < \ldots < s\_n. We must have s_i+1s_i=1s\_{i+1}-s\_i = 1 for 1in11 \le i \le n - 1.

입력

Each test contains multiple test cases. The first line contains the number of test cases tt (1t5001 \le t \le 500). The description of the test cases follows.

For each test case, a single integer nn (1n1051 \leq n \leq 10^5) is given.

It is guaranteed that the sum of nn over all test cases doesn't exceed 10510^5.

출력

For each test case, if it is impossible to make such a pairing, print "No".

Otherwise, print "Yes" followed by nn lines.

At each line, print two integers that are paired.

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

If there are multiple solutions, print any.