#P1758C. Almost All Multiples

Almost All Multiples

Description

Given two integers nn and xx, a permutation^{\dagger} pp of length nn is called funny if pip_i is a multiple of ii for all 1in11 \leq i \leq n - 1, pn=1p_n = 1, and p1=xp_1 = x.

Find the lexicographically minimal^{\ddagger} funny permutation, or report that no such permutation exists.

^{\dagger} A permutation of length nn is an array consisting of each of the integers from 11 to nn exactly once.

^{\ddagger} Let aa and bb be permutations of length nn. Then aa is lexicographically smaller than bb if in the first position ii where aa and bb differ, ai<bia_i < b_i. A permutation is lexicographically minimal if it is lexicographically smaller than all other permutations.

The input consists of multiple test cases. The first line contains an integer tt (1t1041 \leq t \leq 10^4) — the number of test cases. The description of the test cases follows.

The only line of each test case contains two integers nn and xx (2n21052 \leq n \leq 2 \cdot 10^5; 1<xn1 < x \leq n).

The sum of nn across all test cases does not exceed 21052 \cdot 10^5.

For each test case, if the answer exists, output nn distinct integers p1,p2,,pnp_1, p_2, \dots, p_n (1pin1 \leq p_i \leq n) — the lexicographically minimal funny permutation pp. Otherwise, output 1-1.

Input

The input consists of multiple test cases. The first line contains an integer tt (1t1041 \leq t \leq 10^4) — the number of test cases. The description of the test cases follows.

The only line of each test case contains two integers nn and xx (2n21052 \leq n \leq 2 \cdot 10^5; 1<xn1 < x \leq n).

The sum of nn across all test cases does not exceed 21052 \cdot 10^5.

Output

For each test case, if the answer exists, output nn distinct integers p1,p2,,pnp_1, p_2, \dots, p_n (1pin1 \leq p_i \leq n) — the lexicographically minimal funny permutation pp. Otherwise, output 1-1.

样例输入 1

3
3 3
4 2
5 4

样例输出 1

3 2 1 
2 4 3 1 
-1

Note

In the first test case, the permutation [3,2,1][3,2,1] satisfies all the conditions: p1=3p_1=3, p3=1p_3=1, and:

  • p1=3p_1=3 is a multiple of 11.
  • p2=2p_2=2 is a multiple of 22.

In the second test case, the permutation [2,4,3,1][2,4,3,1] satisfies all the conditions: p1=2p_1=2, p4=1p_4=1, and:

  • p1=2p_1=2 is a multiple of 11.
  • p2=4p_2=4 is a multiple of 22.
  • p3=3p_3=3 is a multiple of 33.

We can show that these permutations are lexicographically minimal.

No such permutations exist in the third test case.