Matching Numbers
시간 제한1초메모리 제한1024 MB
1부터 2n까지의 정수를 짝지어 n개의 합이 서로 다른 연속된 값이 되도록 만들고, 불가능하면 No를 출력한다.
문제
You are given an integer . Pair the integers to (i.e. each integer should be in exactly one pair) so that each sum of matched pairs is consecutive and distinct.
Formally, let be the pairs that you matched. should be a permutation of . Let the sorted list of be . We must have for .
입력
Each test contains multiple test cases. The first line contains the number of test cases (). The description of the test cases follows.
For each test case, a single integer () is given.
It is guaranteed that the sum of over all test cases doesn't exceed .
출력
For each test case, if it is impossible to make such a pairing, print "No".
Otherwise, print "Yes" followed by 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.