Chef is interested in the sum of [GCD]s of all prefixes of a permutation of the integers \{1, 2, \ldots, N\}.

Formally, for a permutation P = [P_{1}, P_{2}, \ldots, P_{N}] of \{1, 2, \ldots, N\}, let us define a function F_{i} = \gcd(A_{1}, A_{2}, A_{3}, \ldots, A_{i}). Chef is interested in the value of F_{1} + F_{2} + \ldots + F_{N}.

Now, Chef wants to find a permutation of \{1, 2, \ldots, N\} which has the given sum equal to X. Please help Chef find one such permutation. In case there is no such permutation, print -1. In case of multiple answers, any of them will be accepted.

A permutation of \{1, 2, \ldots, N\} is a sequence of numbers from 1 to N in which each number occurs exactly once.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of a single line containing two space separated integers N and X denoting the length of required permutation and the required sum of GCDs of all prefixes respectively.

------ Output Format ------ 

- If there is a valid permutation that satisfies the required condition, then:
- In a single line, output N space-separated integers denoting the required permutation permutation.
- If there is no permutation, print -1 in a single line. 

------ Constraints ------ 

$1 ≤ T ≤ 10^{4}$
$1 ≤ N ≤ 1000$
$1 ≤ X ≤ 2\cdot N - 1$
- The sum of $N$ over all test cases won't exceed $3\cdot 10^{5}$.

----- Sample Input 1 ------ 
4
1 1
2 1
4 6
3 5

----- Sample Output 1 ------ 
1
-1
2 4 3 1
3 2 1

----- explanation 1 ------ 
Test case $1$: The only possible permutation has a sum of $1$, as required.

Test case $2$: The two permutations of length $2$ are:
- $[1, 2]$ with a value of $1 + 1 = 2$
- $[2, 1]$ with a value of $2 + 1 = 3$

None of them have a sum of $X = 1$, so we output $-1$.

Test case $3$: For $P = [2, 4, 3, 1]$, we have:
- $F_{1} = 2$
- $F_{2} = \gcd(2, 4) = 2$
- $F_{3} = \gcd(2, 4, 3) = 1$
- $F_{4} = \gcd(2, 4, 3, 1) = 1$

The sum of these values is $6$, as required.

Difficulty: EASY

Starter code:

Solutions:
code = int(input())
for i in range(code):
	(vij, hyd) = list(map(int, input().split()))
	if hyd < vij:
		print(-1)
		continue
	print(hyd - vij + 1, end=' ')
	for i in range(1, vij + 1):
		if i != hyd - vij + 1:
			print(i, end=' ')
	print(' ')


t = int(input())
for ni in range(t):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	else:
		l = [i for i in range(1, n + 1)]
		a = x - n + 1
		l.remove(a)
		l.insert(0, a)
		print(*l)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	l = list(range(1, n + 1))
	a = x - n + 1
	if a < 1:
		print(-1)
	else:
		l.remove(a)
		l.insert(0, a)
		print(*l)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
		continue
	start = x - n + 1
	print(start, end=' ')
	i = 1
	while i <= n:
		if i != start:
			print(i, end=' ')
		i += 1
	print()


import numpy as np
for _ in range(int(input())):
	(n, x) = map(int, input().split())
	l = list(np.array(range(1, n + 1)))
	if n != 1:
		if x < n:
			print(-1)
		else:
			m = x - n + 1
			l.remove(m)
			l.insert(0, m)
			print(*l)
	else:
		print(1)


import math
from itertools import permutations
for tc in range(int(input())):
	(n, x) = map(int, input().split())
	l = list(range(1, n + 1))
	ans = []
	if n > x:
		ans.append(-1)
	else:
		ans.append(x - n + 1)
		for j in range(1, n + 1):
			if j != x - (n - 1):
				ans.append(j)
	print(*ans)


for _ in range(int(input())):
	(N, X) = map(int, input().split())
	if N > X:
		print('-1')
	else:
		sstr = str(X - (N - 1))
		for j in range(1, N + 1):
			if j != X - (N - 1):
				sstr += ' ' + str(j)
		print(sstr)


t = int(input(''))
if 1 <= t <= 10 ** 4:
	for _ in range(t):
		(n, x) = map(int, input().split())
		if 1 <= n <= 1000 and 1 <= x <= 2 * n - 1:
			if n <= x:
				z = x - n + 1
				print(z, end=' ')
				for i in range(1, n + 1):
					if i != z:
						print(i, end=' ')
				print()
			else:
				print(-1)


for i in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	else:
		r = x - n + 1
		arr = [str(r)]
		for j in range(1, n + 1):
			if j != r:
				arr.append(str(j))
		print(' '.join(arr))


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if n > x:
		print(-1)
	else:
		f = x - n + 1
		print(f, end=' ')
		for i in range(1, n + 1):
			if i != f:
				print(i, end=' ')
		print()


for _ in range(int(input())):
	(N, X) = map(int, input().split())
	f = X - (N - 1)
	if X < N:
		print(-1)
	else:
		arr = []
		for j in range(1, N + 1):
			arr.append(j)
		arr.remove(f)
		arr.insert(0, f)
		for e in arr:
			print(e, end=' ')
		print('')


for _ in range(int(input())):
	(n, x) = list(map(int, input().split()))
	if n > x:
		print(-1)
		continue
	res = [x - (n - 1)]
	for i in range(1, n + 1):
		if i != res[0]:
			res.append(i)
	print(*res)


for i in range(int(input())):
	(N, X) = map(int, input().split())
	f = X - (N - 1)
	if X < N:
		print(-1)
	else:
		arr = []
		for j in range(1, N + 1):
			arr.append(j)
		arr.remove(f)
		arr.insert(0, f)
		for ele in arr:
			print(ele, end=' ')
		print('')


for _ in range(int(input())):
	(N, X) = map(int, input().split())
	if X < N:
		print('-1')
	else:
		X -= N - 1
		print(X, end=' ')
		for i in range(1, N + 1):
			if i == X:
				continue
			print(i, end=' ')
		print()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if b < a:
		print(-1)
	else:
		print(b - a + 1, *range(1, b - a + 1), *range(b - a + 2, a + 1))


def swap(n, lt):
	lt.remove(n)
	lt.insert(0, n)
	return lt
T = int(input())
for test_cases in range(T):
	(N, X) = map(int, input().split())
	li = [x for x in range(1, N + 1)]
	if len(li) == 1:
		if X == 1:
			print(1)
		else:
			print(-1)
	else:
		a = X - (N - 1)
		if a in li:
			ls = [str(x) for x in swap(a, li)]
			ls1 = ' '.join(ls)
			print(ls1)
		else:
			print(-1)


T = int(input())
for i in range(0, T):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if b < a:
		print(-1)
	elif b >= 2 * a:
		print(-1)
	elif b == a:
		ans = ''
		for j in range(1, a + 1):
			ans += str(j) + ' '
		print(ans)
	else:
		bb = b - a + 1
		ans = str(bb) + ' '
		for j in range(1, a + 1):
			if j != bb:
				ans += str(j) + ' '
		print(ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k < n:
		print(-1)
	else:
		print(k - n + 1, *range(1, k - n + 1), *range(k - n + 2, n + 1))


t = int(input())
for _ in range(t):
	(n, x) = [int(x) for x in input().split()]
	if x < n:
		print(-1)
	else:
		print(x - n + 1, *range(1, x - n + 1), *range(x - n + 2, n + 1))


mod = 1000000007
from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k < n:
		print(-1)
	else:
		print(k - n + 1, end=' ')
		if k != n:
			print('1 ', end='')
		for i in range(2, n + 1):
			if i != k - n + 1:
				print(i, end=' ')
		print()


from collections import defaultdict
import math as m
for _ in range(int(input())):
	(n, s) = (int(i) for i in input().split())
	if s < n:
		print(-1)
	elif s == n:
		print(*[i for i in range(1, n + 1)])
	else:
		first = s - n + 1
		print(first, end=' ')
		for i in range(1, n + 1):
			if i != first:
				print(i, end=' ')
		print()


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if n > x:
		print(-1)
	else:
		print(x - n + 1, end=' ')
		c = 0
		for i in range(1, n + 1):
			if i != x - n + 1 and c < n - 1:
				print(i, end=' ')
				c += 1
		print()


import time
import sys
import math
from collections import defaultdict as dd
from functools import lru_cache
inty = lambda : int(input())
stringy = lambda : input().strip()
mappy = lambda : map(int, input().strip().split())
fmappy = lambda : map(float, input().strip().split())
listy = lambda : list(map(int, input().strip().split()))
tick = lambda : time.perf_counter()
T = inty()
for _ in range(T):
	(n, x) = mappy()
	if x < n:
		print(-1)
		continue
	print(x - n + 1, end=' ')
	for i in range(1, n + 1):
		if i == x - n + 1:
			continue
		print(i, end=' ')
	print()


t = int(input())
while t != 0:
	t -= 1
	nx = list(map(int, input().split()))
	n = nx[0]
	x = nx[1]
	c = []
	d = x - n + 1
	if x >= n and x <= 2 * n - 1:
		if x == 2 * n:
			c += [n]
		else:
			c += [d]
			for i in range(1, d):
				c += [i]
			for i in range(d + 1, n + 1):
				c += [i]
			print(*c)
	else:
		print(-1)


i = int(input(''))
for _ in range(i):
	(l, s) = map(int, input('').split(' '))
	ls = list(range(1, l + 1))
	if l == s:
		for x in ls:
			print(x, end=' ')
		print('')
	elif l > s:
		print('-1')
	else:
		temp = s - l + 1
		print(temp, end=' ')
		for i in range(1, l + 1):
			if i == temp:
				continue
			print(i, end=' ')
		print('')


for t in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	else:
		z = x - n + 1
		print(z, end=' ')
		for i in range(1, n + 1):
			if i == z:
				continue
			else:
				print(i, end=' ')
		print('\n')


t = int(input())
while t:
	t -= 1
	(n, x) = list(map(int, input().split()))
	if x < n:
		print(-1, end=' ')
	elif n == x:
		for i in range(1, n + 1):
			print(i, end=' ')
	else:
		print(x - n + 1, end=' ')
		for i in range(1, n + 1):
			if i != x - n + 1:
				print(i, end=' ')
	print()


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
	else:
		a = x - n + 1
		if a == 1:
			for i in range(n):
				print(i + 1, end=' ')
			print()
		else:
			b = [0] * n
			b[0] = a
			b[1] = 1
			j = 2
			for i in range(2, n):
				if j not in b:
					b[i] = j
					j += 1
				else:
					j += 1
					b[i] = j
			for i in b:
				print(i, end=' ')
			print()


for i in range(int(input())):
	(N, X) = map(int, input().split())
	if X < N:
		print(-1)
	else:
		s = f'{X - N + 1} '
		for j in range(1, N + 1):
			if j != X - N + 1:
				s += f'{j} '
		s = s[:-1]
		print(s)


for _ in range(int(input())):
	A = []
	(n, x) = map(int, input().split())
	if x < n:
		A.append(-1)
	else:
		A.append(x - (n - 1))
		for i in range(1, n + 1):
			if i != A[0]:
				A.append(i)
	print(*A)


for _ in range(int(input())):
	(n, x) = list(map(int, input().split()))
	if x < n:
		print(-1)
		continue
	perm = [i for i in range(1, n + 1)]
	perm.remove(x - n + 1)
	perm = [x - n + 1] + perm
	print(*perm)


for i in range(int(input())):
	(n, x) = map(int, input().split())
	m = x - n
	if x < n:
		print(-1)
	else:
		print(m + 1, end=' ')
		for i in range(1, n + 1):
			if i != m + 1:
				print(i, end=' ')
		print('')


t = int(input())
for i in range(t):
	(n, add) = input().split()
	n = int(n)
	add = int(add)
	if n > add:
		print('-1')
	else:
		diff = add - (n - 1)
		list1 = []
		list1.append(diff)
		for i in range(1, n + 1):
			if i not in list1:
				list1.append(i)
		print(*list1)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	elif x == n:
		arr = [i for i in range(1, n + 1)]
		print(*arr)
	else:
		tele = x - n + 1
		arr = [tele, 1]
		for i in range(1, n + 1):
			if i == tele or i == 1:
				continue
			else:
				arr.append(i)
		print(*arr)


for t in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	else:
		l = [i for i in range(1, n + 1)]
		l.remove(x - n + 1)
		res = [x - n + 1] + l
		for val in res:
			print(val, end=' ')
		print()


tc = int(input())
for TC in range(tc):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
	else:
		val = x - n
		val += 1
		print(val, end=' ')
		for i in range(1, n + 1):
			if i != val:
				print(i, end=' ')
		print()


T = int(input())
for test in range(0, T):
	(N, X) = map(int, input().strip().split())
	if X < N or X > 2 * N - 1:
		print(-1)
	else:
		target = X - N
		L = [target + 1]
		for i in range(1, N + 1):
			if i != target + 1:
				L.append(i)
		print(*L)


for _ in range(int(input())):
	l = list(map(int, input().split()))
	n = l[0]
	x = l[1]
	if n > x:
		print(-1)
		continue
	n1 = 1
	e = x - n + 1
	print(e, end=' ')
	for i in range(1, n):
		if n1 == e:
			n1 += 1
		print(n1, end=' ')
		n1 += 1
	print('')


from itertools import permutations
from math import *
for t in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
	else:
		l = [x - n + 1]
		for i in range(1, n + 1):
			if i not in l:
				l.append(i)
		print(*l)


for t in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
	elif x >= n:
		i = x - n + 1
		p = [str(i)]
		s = 1
		while s <= n:
			if s != i:
				p.append(s)
			s += 1
		print(*p)


A = list(range(1, 1001))
for _ in range(int(input())):
	(N, X) = [int(x) for x in input().split()]
	if X < N:
		print(-1)
	elif X == N:
		print(*A[:N])
	else:
		print(X - N + 1, *A[:X - N], *A[X - N + 1:N])


for _ in range(int(input())):
	(N, X) = [int(x) for x in input().split()]
	if X < N:
		print(-1)
	elif X == N:
		print(*list(range(1, N + 1)))
	else:
		print(X - N + 1, *list(range(1, X - N + 1)), *list(range(X - N + 2, N + 1)))


t = int(input())
for i in range(t):
	(n, x) = list(map(int, input().split()))
	if n > x:
		print(-1)
	elif n == x:
		for j in range(1, n + 1):
			print(j, end=' ')
		print()
	else:
		y = x - n + 1
		if y in range(1, n + 1):
			print(y, end=' ')
			for j in range(1, n + 1):
				if j == y:
					continue
				else:
					print(j, end=' ')
			print()
		else:
			print(-1)


for t in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
	elif x >= n:
		i = x - n + 1
		plst = [str(i)]
		start = 1
		while start <= n:
			if start != i:
				plst.append(start)
			start += 1
		print(*plst)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
	else:
		ans = [i for i in range(1, n + 1)]
		j = x - n + 1
		print(j, end=' ')
		ans.remove(j)
		print(*ans)


t = int(input())
while t > 0:
	t -= 1
	(n, x) = map(int, input().split(' '))
	if x < n:
		print(-1)
	elif x == n:
		lst = []
		start = 1
		while start <= n:
			lst.append(str(start))
			start += 1
		print(' '.join(lst))
	else:
		idk = x - n + 1
		lst = [str(idk)]
		start = 1
		while start <= n:
			if start != idk:
				lst.append(str(start))
			start += 1
		print(' '.join(lst))


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
		continue
	s = x - n + 1
	print(s, end=' ')
	ans = [x for x in range(1, n + 1) if x != s]
	print(*ans)


def solve():
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
		return
	i = x - n + 1
	print(i, end=' ')
	for j in range(1, n + 1):
		if j != i:
			print(j, end=' ')
	print()
t = int(input())
while t:
	solve()
	t -= 1


for i in range(int(input())):
	l = list(map(int, input().split(' ')))
	ans = []
	if l[1] < l[0]:
		print(-1)
	else:
		ans.append(l[1] - l[0] + 1)
		for i in range(1, l[1] - l[0] + 1):
			ans.append(i)
		for i in range(l[1] - l[0] + 2, l[0] + 1):
			ans.append(i)
		print(*ans)


t = int(input())

def solve():
	(n, x) = map(int, input().split(' '))
	if x < n:
		print(-1)
	else:
		a = x - n + 1
		print(a, end=' ')
		for i in range(1, n + 1):
			if a != i:
				print(i, end=' ')
		print()
for _ in range(t):
	solve()


t = int(input())
for i in range(t):
	(n, x) = input().split()
	(n, x) = (int(n), int(x))
	ans = []
	if x < n:
		print(-1)
	else:
		p = x - n + 1
		ans.append(p)
		for i in range(1, x - n + 1):
			ans.append(i)
		for i in range(x - n + 2, n + 1):
			ans.append(i)
		print(*ans)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print('-1')
		continue
	a1 = x - n + 1
	ans = [str(a1)]
	ans = ans + [str(i) for i in range(1, n + 1) if i != a1]
	print(' '.join(ans))


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(a, b) = map(int, input().split())
	if b < a:
		print(-1)
	else:
		ans = [b - a + 1]
		for i in range(1, a + 1):
			if i != ans[0]:
				ans.append(i)
		for i in ans:
			print(i, end=' ')
		print()


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if b < a:
		print(-1)
	else:
		ans = [b - a + 1]
		for i in range(1, a + 1):
			if i != ans[0]:
				ans.append(i)
		for i in ans:
			print(i, end=' ')
		print()


T = int(input())
for i in range(0, T):
	(N, X) = map(int, input().split(' '))
	if X < N:
		print('-1')
	else:
		j = X - N + 1
		print(j, ' ', end='')
		for k in range(1, N + 1):
			if k != j:
				print(k, ' ', end='')
		print()


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
		continue
	print(x - n + 1, end=' ')
	for j in range(1, n + 1):
		if j != x - n + 1:
			print(j, end=' ')
	print(' ')


def solution():
	(N, S) = map(int, input().split())
	if S < N:
		print(-1)
		return
	F = S - N + 1
	print(F, end=' ')
	for i in range(1, N + 1):
		if i != F:
			print(i, end=' ')
	print()
T = int(input())
while T > 0:
	T = T - 1
	solution()


T = int(input())
while T > 0:
	(n, x) = [int(i) for i in input().split(' ')]
	if x < n:
		print('-1')
		T -= 1
		continue
	a1 = x - n + 1
	ans = [str(a1)]
	ans = ans + [str(i) for i in range(1, n + 1) if i != a1]
	print(' '.join(ans))
	T -= 1


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	c = x - n
	if c < 0:
		print(-1)
	else:
		print(c + 1, end=' ')
		for i in range(1, n + 1):
			if i == c + 1:
				pass
			else:
				print(i, end=' ')
	print('\n')


for _ in range(int(input())):
	(n, x) = list(map(int, input().split()))
	if n > x:
		print(-1)
	else:
		print(x - n + 1, end=' ')
		for z in range(n):
			if z + 1 == x - n + 1:
				continue
			print(z + 1, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, x) = map(int, input().split())
	if n > x:
		print(-1)
	elif x == n:
		for i in range(1, n + 1):
			if i == n:
				print(i)
			else:
				print(i, end=' ')
	else:
		c = x - n + 1
		print(c, end=' ')
		for i in range(1, n + 1):
			if i == c:
				continue
			elif i == n:
				print(i)
			else:
				print(i, end=' ')


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	if x < n:
		print(-1)
		continue
	val = x - n + 1
	print(val, end=' ')
	for i in range(1, n + 1):
		if i != val:
			print(i, end=' ')
	print()


t = int(input())
c = 0
for i in range(t):
	(n, x) = map(int, input().split(' '))
	if x < n:
		print(-1)
	else:
		t = x - n + 1
		a = [t]
		for i in range(1, n + 1):
			if i not in a:
				a.append(i)
		print(*a)