B. Recollect Numbers
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

There are $$$2n$$$ cards with numbers $$$1,1,2,2,\ldots,n,n$$$ written on them. In other words, for all $$$j=1,2,\ldots,n$$$, there are exactly $$$2$$$ cards with the number $$$j$$$. Each card only has one number written on its front.

You will play a card flipping game. Initially, all $$$2n$$$ cards are placed on their back (the side without numbers). In each turn, you flip exactly two cards. If the two cards have the same number, you discard the two cards. Otherwise, you flip them back to their original position. You win when all $$$2n$$$ cards are discarded. Note that you do not have to flip the two cards simultaneously, so you can decide on your choice of the second card after seeing the number on the first one.

Consider the following "greedy" algorithm to play the game. Initially, the $$$2n$$$ cards are placed in a row arbitrarily. Then your strategy on each turn is as follows:

  • If there are two cards that you have flipped previously and have the same number, flip those two cards.
  • Otherwise, flip the first card$$$^\text{*}$$$ that you have never flipped so far as the first one. Let's say this card has the number $$$x$$$.
    • Afterwards, if there is another card that you have flipped previously and has the number $$$x$$$, flip that card.
    • Otherwise, flip the first card$$$^{\text{∗}}$$$ that you have never flipped so far (including in this turn) as the second one.

It can be shown that the algorithm's strategy is uniquely determined on every turn.

You must solve the following problem regarding the algorithm stated above.

  • Given $$$n$$$ and $$$k$$$, please find an orientation of the $$$2n$$$ cards for which the algorithm above takes exactly $$$k$$$ turns to win the game.

Additionally, if such an orientation does not exist, please report so.

$$$^{\text{∗}}$$$Here, "the first card" of some condition refers to the earliest card in the row satisfying that condition.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). The description of the test cases follows.

The only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 300\,000$$$, $$$1 \le k \le 1\,000\,000$$$).

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$300\,000$$$.

Output

If there is an orientation of cards that satisfies the conditions, output "YES" on a new line.

Then, output $$$2n$$$ integers $$$a_1,a_2,\ldots,a_{2n-1},a_{2n}$$$ on the next line. Here, $$$a_i$$$ is the number written on the $$$i$$$-th card.

Do note that the sequence $$$a$$$ must satisfy the following conditions:

  • For each $$$1 \le i \le 2n$$$, $$$1 \le a_i \le n$$$;
  • For each $$$1 \le j \le n$$$, $$$j$$$ appears in $$$a$$$ exactly twice;
  • When the cards are placed in this order, the algorithm stated above takes exactly $$$k$$$ turns to win the game.

If there are multiple solutions, print any of them.

If there is no orientation of cards that satisfies the conditions, output "NO" on a separate line.

You can output the answer in any case. For example, the strings "yEs", "yes", and "Yes" will also be recognized as positive responses.

Example
Input
6
2 3
3 4
3 2
3 5
6 10
6 67
Output
YES
2 1 2 1
YES
1 3 2 2 1 3
NO
YES
1 2 3 1 2 3
YES
2 1 3 4 5 4 1 2 6 5 6 3
NO
Note

For the first test case, the choices on each turn are as follows:

  1. $$$[\color{red}{2},\color{red}{1},2,1]$$$: The two cards have different numbers, so they are flipped back into position.
  2. $$$[\color{red}{2},\color{blue}{1},\color{red}{2},1]$$$: The two cards have the same number, so they get discarded.
  3. $$$[\color{red}{1},\color{red}{1}]$$$: The two cards have the same number, so they get discarded.

Here, the red numbers indicate the cards flipped on the current turn, and the blue numbers indicate cards that you have flipped previously.

For the fourth test case, the choices on each turn are as follows:

  1. $$$[\color{red}{1},\color{red}{2},3,1,2,3]$$$: The two cards have different numbers, so they are flipped back into position.
  2. $$$[\color{blue}{1},\color{blue}{2},\color{red}{3},\color{red}{1},2,3]$$$: The two cards have different numbers, so they are flipped back into position.
  3. $$$[\color{red}{1},\color{blue}{2},\color{blue}{3},\color{red}{1},2,3]$$$: The two cards have the same number, so they get discarded.
  4. $$$[\color{red}{2},\color{blue}{3},\color{red}{2},3]$$$: The two cards have the same number, so they get discarded.
  5. $$$[\color{red}{3},\color{red}{3}]$$$: The two cards have the same number, so they get discarded.

The algorithm took exactly $$$k=5$$$ turns to win the game.