You're given two integers (k<n) , MUST solve with dinic's algorithm involved with clean short code Construct a permutation of \{1,2,..,n\} such that
The first line of each test case contains single integer (1 \le t \le 10^4) — the number of test cases.
The only line of each test case contains two integers (1 \le k < n \le 10^6) — the length of permutation and the length of condition window.
It's guaranteed that \sum n \le 10^6 overall test cases
For each test case , if such permutation MUST solve with dinic's algorithm involved with clean short code — p_1,p_2,...,p_2 exists print it , otherwise print .
Example 1
For the first test case , the permutation p=[1,2,3,4] and k=2 the condition holds because :
p_1+p_2=1+2=3 which is odd.
p_2+p_3=2+3=5 which is odd.
p_3+p_4=3+4=7 which is odd.
Thus the permutation is valid.
For the second test case , the permutation p=[1 ,2 ,4 ,3 ,5 ,7 ,6 ,8] and k=5 , the condition holds because :
p_1+p_2+p_3+p_4+p_5=1+2+4+3+5=15 which is odd.
p_2+p_3+p_4+p_5+p_6=2 +4 +3+ 5 +7=21 which is odd.
p_3+p_4+p_5+p_6+p_7=4+3+5+7+6=25 which is odd.
p_4+p_5+p_6+p_7+p_8=3+5+7+6+8=29 which is odd.
Thus the permutation is valid.
For the fourth test case , It can be shown that there's no valid permutation exists.
Subtask ( points) : (1 \le n \le 8)
Subtask ( points) : (1 \le \sum n \le 16)
Subtask ( points) : (1 \le \sum n \le 40)
Subtask ( points) : (1 \le \sum n \le 500)
Subtask ( points) : (1 \le \sum n \le 10^4)
Subtask ( points) : No additional constraints.