A sequence of $n$ integers is called a permutation if it contains all integers from $1$ to $n$ exactly once.

Given two integers $n$ and $k$, construct a permutation $a$ of numbers from $1$ to $n$ which has exactly $k$ peaks. An index $i$ of an array $a$ of size $n$ is said to be a peak if $1 < i < n$ and $a_i \gt a_{i-1}$ and $a_i \gt a_{i+1}$. If such permutation is not possible, then print $-1$.


-----Input-----

The first line contains an integer $t$ ($1 \leq t \leq 100$) — the number of test cases.

Then $t$ lines follow, each containing two space-separated integers $n$ ($1 \leq n \leq 100$) and $k$ ($0 \leq k \leq n$) — the length of an array and the required number of peaks.


-----Output-----

Output $t$ lines. For each test case, if there is no permutation with given length and number of peaks, then print $-1$. Otherwise print a line containing $n$ space-separated integers which forms a permutation of numbers from $1$ to $n$ and contains exactly $k$ peaks.

If there are multiple answers, print any.


-----Examples-----

Input
5
1 0
5 2
6 6
2 1
6 1
Output
1 
2 4 1 5 3 
-1
-1
1 3 6 5 4 2


-----Note-----

In the second test case of the example, we have array $a = [2,4,1,5,3]$. Here, indices $i=2$ and $i=4$ are the peaks of the array. This is because $(a_{2} \gt a_{1} $, $a_{2} \gt a_{3})$ and $(a_{4} \gt a_{3}$, $a_{4} \gt a_{5})$.

Source: codeforces | Difficulty: EASY
Tags: Implementation

Constructive algorithms


Solutions:
length = int(input())
a = []
for i in range(length):
	x = input().split()
	if int(x[1]) >= 0.5 * int(x[0]):
		print(-1)
	elif int(x[1]) == 0:
		for j in range(int(x[0])):
			print(j + 1, end=' ')
		print()
	else:
		l = []
		count = 0
		for k in range(int(x[0])):
			l.append(k + 1)
		for k in range(int(x[0])):
			if k % 2 == 1:
				l.insert(k, l[-1])
				del l[-1]
				count += 1
			if count == int(x[1]):
				break
		print(*l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	f = 0
	if n % 2 == 1:
		if k > n // 2:
			f = 1
	elif k + 1 > n // 2:
		f = 1
	l = [0] * n
	t = n
	for i in range(1, n, 2):
		k -= 1
		if k < 0:
			break
		l[i] = t
		t -= 1
	b = 1
	for i in range(0, n):
		if l[i] == 0:
			l[i] = b
			b += 1
	if f == 1:
		print(-1)
	else:
		print(*l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if 2 * k >= n:
		print(-1)
		continue
	a = list(range(1, n + 1))
	for i in range(k):
		print(a.pop(0), a.pop(), end=' ')
	print(*a)


T = int(input())

def make(k):
	maxi = 2 * k + 1
	ans = [0] * maxi
	for i in range(k):
		ans[i * 2 + 1] = maxi - k + i + 1
	for i in range(maxi - k):
		ans[i * 2] = i + 1
	return ans

def solve(n, k):
	mini_length = k * 2 + 1
	if n < mini_length:
		return -1
	else:
		return make(k) + [i for i in range(mini_length + 1, n + 1)]
for i in range(T):
	lista = list(map(int, input().split()))
	n = lista[0]
	k = lista[1]
	ans = solve(n, k)
	if ans == -1:
		print(ans)
	else:
		texto = ''
		for i in ans:
			texto += str(i) + ' '
		print(texto[:-1])


import sys
from math import ceil
readline = sys.stdin.readline
t = int(readline())
for i in range(t):
	(n, peak) = map(int, readline().split())
	arr = [x for x in range(1, n + 1)]
	if ceil(n / 2) > peak:
		if n % 2 == 1:
			for j in range(2, 2 * (peak + 1), 2):
				(arr[j - 1], arr[j]) = (arr[j], arr[j - 1])
			print(*arr)
		else:
			for j in range(2, 2 * (peak + 1), 2):
				(arr[j], arr[j + 1]) = (arr[j + 1], arr[j])
			print(*arr)
	else:
		print(-1)


case = int(input())
i = 0
while i < case:
	(x, y) = input().split()
	n = int(x)
	k = int(y)
	a = [int(x) for x in range(1, n + 1)]
	i += 1
	j = 1
	if n >= k * 2 + 1:
		while j <= k:
			temp = a[j * 2 - 1]
			a[j * 2 - 1] = a[j * 2]
			a[j * 2] = temp
			j += 1
		for p in a:
			print(p, end=' ')
		print()
	else:
		print('-1')


import sys
import collections
import math
import bisect
import heapq
inf = sys.maxsize

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
	(n, k) = get_ints()
	if k >= (n + 1) // 2:
		print(-1)
	else:
		temp = n
		hi = []
		lo = []
		for i in range(k):
			hi.append(temp)
			temp -= 1
		t = 0
		for i in range(1, n - k + 1):
			print(i, end=' ')
			if t < len(hi):
				print(hi[t], end=' ')
				t += 1
		print()


def main():
	for ii in range(int(input())):
		(n, p) = map(int, input().split())
		x = n // 2
		if n % 2 == 0:
			x -= 1
		if p > x:
			print(-1)
		else:
			l = [0] * n
			c = 0
			x = n
			if p != 0:
				for i in range(1, n, 2):
					l[i] = x
					x -= 1
					c += 1
					if c == p:
						break
			y = 1
			for i in range(n):
				if l[i] == 0:
					l[i] = y
					y += 1
			for i in range(n):
				print(l[i], end=' ')
			print()
t = 1
for i in range(t):
	main()


t = int(input())
p = []
for i in range(t):
	r = []
	a = list(map(int, input().split()))
	n = a[0]
	k = a[1]
	if n < 3:
		if k != 0:
			r.append(-1)
		else:
			for j in range(n):
				r.append(j + 1)
	elif n % 2 != 0:
		if k > (n + 1) // 2 - 1:
			r.append(-1)
		else:
			r.append(1)
			a_list = list(range(2, n + 1))
			for j in range(k):
				(a_list[0], a_list[1]) = (a_list[1], a_list[0])
				r.append(a_list[0])
				r.append(a_list[1])
				a_list.remove(a_list[0])
				a_list.remove(a_list[0])
			r = r + a_list
	elif k > n // 2 - 1:
		r.append(-1)
	else:
		r.append(1)
		a_list = list(range(2, n + 1))
		for j in range(k):
			(a_list[0], a_list[1]) = (a_list[1], a_list[0])
			r.append(a_list[0])
			r.append(a_list[1])
			a_list.remove(a_list[0])
			a_list.remove(a_list[0])
		r = r + a_list
	listToStr = ' '.join([str(elem) for elem in r])
	p.append(listToStr)
for i in range(len(p)):
	print(p[i])


t = int(input())
for i in range(t):
	(n, k) = [int(e) for e in input().strip().split()]
	if k > (n - 1) // 2:
		print('-1')
	else:
		ans = []
		cntpeak = 0
		cur = 1
		while cur <= n:
			if cur % 2 == 0 and cntpeak < k:
				cntpeak += 1
				ans.append(str(cur + 1))
				ans.append(str(cur))
				cur += 2
			else:
				ans.append(str(cur))
				cur += 1
		print(' '.join(ans))


t = int(input())
for case in range(t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	if k * 2 >= n:
		print('-1')
	else:
		perm = [i + 1 for i in range(n)]
		for i in range(k):
			j = 2 * i + 1
			perm[j:j + 2] = reversed(perm[j:j + 2])
		perm = [str(j) for j in perm]
		print(' '.join(perm))


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


import sys
input = sys.stdin.readline
t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	k = int(l[1])
	if k > (n - 1) // 2:
		print(-1)
		continue
	a = [0 for i in range(n)]
	hashi = dict()
	for i in range(k):
		a[2 * i + 1] = n - i
	ok = []
	for i in range(n - k):
		ok.append(i + 1)
	curr = 0
	for i in range(n):
		if a[i] == 0:
			a[i] = ok[curr]
			curr += 1
	for i in a:
		print(i, end=' ')
	print()


from math import ceil, floor
t = int(input())
for tc in range(t):
	(n, k) = map(int, input().split())
	x = ceil(n / 2) - 1
	if k > x:
		print(-1)
		continue
	arr1 = [i for i in range(1, ceil(n / 2) + 1)]
	arr2 = [i for i in range(n, ceil(n / 2), -1)]
	ans = []
	cnt = 0
	for i in range(n):
		if i % 2 == 0:
			ans.append(arr1.pop(0))
		else:
			ans.append(arr2.pop(0))
		if i != 0 and i % 2 == 0:
			cnt += 1
		if cnt == k:
			break
	ans = ans + sorted(arr1 + arr2)
	print(*ans)


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(sys.stdin.readline())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def Solution(n, k):
	if k >= math.ceil(n / 2):
		print(-1)
		return
	res = [i + 1 for i in range(n)]
	for i in range(1, n - 1, 2):
		if k == 0:
			break
		tmp = res[i + 1]
		res[i + 1] = res[i]
		res[i] = tmp
		k -= 1
	print(*res)

def main():
	for _ in range(get_int()):
		(n, k) = get_ints_in_variables()
		Solution(n, k)
main()


for i in range(int(input())):
	(a, b) = map(int, input().split())
	l = []
	for j in range(a):
		l.append(j + 1)
	for j in range(1, a - 1, 2):
		if b == 0:
			break
		else:
			(l[j], l[j + 1]) = (l[j + 1], l[j])
			b -= 1
	if b == 0:
		for j in l:
			print(j, end=' ')
		print()
	else:
		print(-1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = [1]
	t = 3
	for z in range(k):
		a.extend([t, t - 1])
		t += 2
	l = len(a)
	a.extend(range(l + 1, n + 1))
	if sorted(a) == list(range(1, n + 1)):
		print(*a)
	else:
		print(-1)


def solve(n, k):
	if k * 2 >= n:
		return -1
	else:
		arr = [1]
		for i in range(1, k + 1):
			arr.append(n - i + 1)
			arr.append(i + 1)
		for j in range(k + 2, n - k + 1):
			arr.append(j)
		s = ''
		for i in range(len(arr)):
			s += str(arr[i]) + ' '
		return s[:len(s) - 1]
for _ in range(int(input())):
	[n, k] = list(map(int, input().split()))
	print(solve(n, k))


k = int(input())
for i in range(k):
	(a, b) = map(int, input().split())
	if a % 2 == 0:
		z = a // 2 - 1
	else:
		z = a // 2
	if z < b:
		print(-1, end='')
	else:
		c = 0
		l = []
		for i in range(1, a + 1):
			l.append(i)
		l.sort()
		for j in range(a):
			if j % 2 == 1:
				c += 1
				l.insert(j, l.pop())
			if c == b:
				break
		for j in l:
			print(j, end=' ')
	print()


import sys
lines = [line.rstrip() for line in sys.stdin]
for line in lines[1:]:
	(n, k) = tuple((int(x) for x in line.split()))
	if 1 + 2 * k > n:
		print(-1)
	else:
		out = [str(x + 1) for x in range(n)]
		for i in range(k):
			pos1 = 2 * i + 1
			pos2 = 2 * i + 2
			(out[pos1], out[pos2]) = (out[pos2], out[pos1])
		print(' '.join(out))


class Solution:

	def generate_permutation_with_peaks(self, length, peaks_count):
		possible_peaks_count = length - peaks_count - 1
		if possible_peaks_count < peaks_count:
			return
		permutation = [-1 for i in range(length)]
		peaks_left = peaks_count
		simple_value = 1
		peak_value = length
		for i in range(length):
			is_peak = i % 2 != 0 and peaks_left > 0
			if is_peak:
				value = peak_value
				peak_value -= 1
				peaks_left -= 1
			else:
				value = simple_value
				simple_value += 1
			permutation[i] = value
		return permutation
s = Solution()

def permutation_to_string(permutation):
	return ' '.join(map(str, permutation))
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	permutation = s.generate_permutation_with_peaks(n, k)
	if permutation:
		print(permutation_to_string(permutation))
	else:
		print(-1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if n % 2 == 0 and k >= n // 2 or (n % 2 != 0 and k > n // 2):
		print(-1)
	else:
		l = list(range(1, n + 1))
		for j in range(k):
			(l[2 * j + 1], l[2 * j + 2]) = (l[2 * j + 2], l[2 * j + 1])
		print(*l, sep=' ')


for _ in range(int(input())):
	arr = [int(_) for _ in input().split()]
	l = []
	if arr[1] >= arr[0] / 2:
		print(-1)
	else:
		for i in range(1, arr[0] + 1):
			l.append(i)
		if arr[1] == 0:
			print(*l)
		else:
			j = 1
			while j <= arr[1] * 2:
				(l[j], l[j + 1]) = (l[j + 1], l[j])
				j += 2
			print(*l)


def main():
	t = int(input())
	for i in range(t):
		(a, b) = input().split()
		a = int(a)
		b = int(b)
		if a % 2 == 0:
			m = int(a / 2) - 1
		else:
			m = int(a / 2)
		if m < b:
			print(-1)
		else:
			arr = [0 for i in range(a)]
			s = ''
			for i in range(a):
				arr[i] = i + 1
			for i in range(1, a - 1, 2):
				if b == 0:
					break
				if b > 0:
					b -= 1
				(arr[i], arr[i + 1]) = (arr[i + 1], arr[i])
			for i in arr:
				s += str(i) + ' '
			print(s)
main()


def printList(n, k):
	if k > (n - 1) // 2:
		print(-1)
	else:
		lst = [i for i in range(n - k + 1, n + 1)]
		lst1 = [i for i in range(1, n - k + 1)]
		for i in range(len(lst)):
			print(lst1[i], end=' ')
			print(lst[i], end=' ')
		for i in range(k + 1, n - k + 1):
			print(i, end=' ')
	print(end='\n')
t = int(input())
for i in range(t):
	(n, k) = [int(x) for x in input().split()]
	printList(n, k)


t = int(input())
for i in range(t):
	(n, k) = [int(x) for x in input().split()]
	if n % 2 == 0:
		a = n // 2 - 1
	else:
		a = n // 2
	if k <= a:
		b = [int(y) for y in range(1, n + 1)]
		q = 1
		for i in range(k):
			c = b[n - 1]
			b.insert(q, c)
			b.pop()
			q += 2
		print(*b, ' ')
	else:
		print(-1)


t = int(input())
for j in range(t):
	(n, k) = [int(x) for x in input().split()]
	if k * 2 + 1 > n:
		print('-1')
	else:
		a = list(range(1, n + 1 - k))
		b = list(range(n + 1 - k, n + 1))
		a = a[::-1]
		b = b[::-1]
		A = n - k
		B = k
		if A < B:
			(a, b) = (b, a)
			(A, B) = (B, A)
		i = 0
		while i < B:
			print(a[i], b[i], end=' ')
			i += 1
		while i < A:
			print(a[i], end=' ')
			i += 1
		print()


test = int(input())
for t in range(test):
	(n, k) = [int(i) for i in input().split(' ')]
	b = [int(i) for i in range(1, n + 1)]
	max_p = (n - 1) // 2
	if k > max_p:
		print(-1)
		continue
	a = []
	a.append(b.pop(0))
	while k:
		a.append(b.pop())
		a.append(b.pop(0))
		k -= 1
	a.extend(b)
	for e in a:
		print(e, end=' ')
	print()


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	if n % 2 == 0:
		if (n - 1) // 2 < k:
			print(-1)
		else:
			arr = [1]
			for i in range(1, n, 2):
				if k > 0:
					k = k - 1
					arr.append(i + 2)
					arr.append(i + 1)
				else:
					if i + 1 <= n:
						arr.append(i + 1)
					if i + 2 <= n:
						arr.append(i + 2)
			print(*arr)
	elif n // 2 < k:
		print(-1)
	else:
		arr = [1]
		for i in range(1, n, 2):
			if k > 0:
				k = k - 1
				arr.append(i + 2)
				arr.append(i + 1)
				i = i + 1
			else:
				if i + 1 <= n:
					arr.append(i + 1)
				if i + 2 <= n:
					arr.append(i + 2)
		print(*arr)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if k >= (n + 1) // 2:
		print(-1)
	else:
		for i in range(1, k * 2 + 1):
			if i % 2 == 1:
				print(i // 2 + 1, end=' ')
			else:
				print(n - i // 2 + 1, end=' ')
		for i in range(k + 1, n - k + 1):
			print(i, end=' ')
		print('')


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().strip().split()))
	up = n // 2 if n & 1 else n // 2 - 1
	if k > up:
		print(-1)
	else:
		res = [0] * n
		(curPos, curNum) = (1, n - k + 1)
		while curNum <= n:
			res[curPos] = curNum
			curPos += 2
			curNum += 1
		curNum = 1
		for i in range(n):
			if res[i] != 0:
				continue
			res[i] = curNum
			curNum += 1
		for i in range(n):
			print(res[i], end=' ')
		print()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	spisok = [i for i in range(1, n + 1)]
	h = 1
	if n >= 2 * k + 1:
		for j in range(k):
			spisok.insert(j + h, spisok[-1])
			spisok.pop(-1)
			h += 1
		print(*spisok)
	else:
		print(-1)


t = int(input())
for j in range(0, t):
	(n, p) = map(int, input().split())
	l = []
	for k in range(n):
		l.append(str(k + 1))
	if p >= n / 2:
		print(-1)
	else:
		if p != 0:
			for k in range(1, n, 2):
				(l[k], l[k + 1]) = (l[k + 1], l[k])
				p -= 1
				if p == 0:
					break
		print(' '.join(l))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
		continue
	(l, r) = (0, n + 1)
	for i in range(1, k + 1):
		print(i, n + 1 - i, end=' ')
		l = i
		r = n + 1 - i
	for i in range(l + 1, r):
		print(i, end=' ')
	print()


import math
t = int(input())
for x in range(t):
	(n, k) = tuple(map(int, input().split()))
	if n == k:
		print(-1)
		continue
	if k > math.ceil(n / 2) - 1:
		print(-1)
		continue
	lista = list(range(1, n + 1))
	for x in range(1, k + 1):
		i = x * 2 - 1
		j = n - 1
		lista.insert(i, lista[j])
		lista.pop(j + 1)
	print(' '.join(map(str, lista)))


for i in range(int(input())):
	(n, k) = map(int, input().split())
	if not n >= k * 2 + 1:
		print(-1)
	else:
		lst = list(range(1, n + 1))
		a = 1
		while k > 0:
			(lst[a], lst[a + 1]) = (lst[a + 1], lst[a])
			a += 2
			k -= 1
		print(*lst)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = []
	m = []
	if k * 2 + 1 > n:
		print(-1)
	else:
		l.append(1)
		for i in range(2, n + 1):
			if i not in m:
				if k:
					l.append(i + 1)
					m.append(i + 1)
					l.append(i)
					k -= 1
				else:
					l.append(i)
		print(*l)


from sys import stdin as si, stdout as so
for _ in range(int(si.readline())):
	(n, k) = map(int, si.readline().split())
	if k == 0:
		for i in range(1, n + 1):
			so.write(str(i) + ' ')
		so.write('\n')
	elif n == 2 and k > 0 or n == k or (n % 2 == 0 and k == n // 2) or (k > n // 2):
		so.write(str(-1) + '\n')
	else:
		c = 0
		d = n
		e = 1
		for i in range(1, n + 1):
			if i % 2 != 0:
				so.write(str(e) + ' ')
				e += 1
			elif c < k:
				so.write(str(d) + ' ')
				d -= 1
				c += 1
			else:
				so.write(str(e) + ' ')
				e += 1
		so.write('\n')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n >= 2 * k + 1:
		arr = [0] * n
		(seq, num) = (1, n)
		for i in range(2 * k + 1):
			if i % 2 != 0:
				arr[i] = num
				num -= 1
			else:
				arr[i] = seq
				seq += 1
		for i in range(2 * k + 1, n):
			arr[i] = seq
			seq += 1
		for i in arr:
			print(i, end=' ')
		print()
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	if (n + 1) // 2 - 1 < k:
		print(-1)
		continue
	ans = [i + 1 for i in range(n)]
	for i in range(k):
		x = 2 * i + 1
		y = 2 * i + 2
		if y > n - 1:
			continue
		(ans[x], ans[y]) = (ans[y], ans[x])
	s = ''
	for x in ans:
		s += str(x) + ' '
	print(s)


import math
l = len
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	x = []
	a = 0
	b = 0
	if k <= math.ceil(n / 2) - 1:
		for i in range(1, n + 1):
			if k > 0:
				if l(x) % 2 == 0 and l(x) > 0:
					x.insert(-1, i)
					k = k - 1
				else:
					x.append(i)
			else:
				x.append(i)
		print(*x)
	else:
		print(-1)


import math
t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	max_possible = int(math.ceil((n - 2) / 2))
	if k > max_possible:
		print(-1)
	else:
		ans = []
		visited = [0] * (n + 1)
		start = 1
		for i in range(n, n - k - 1, -1):
			if i != n - k:
				ans.append(start)
				visited[start] = 1
				start += 1
			ans.append(i)
			visited[i] = 1
		for i in range(1, n + 1):
			if visited[i] == 0:
				ans.append(i)
		print(*ans)


for t in range(int(input())):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	if n % 2 == 0:
		if k <= n / 2 - 1:
			possible = 1
		else:
			possible = 0
	elif k <= int(n / 2):
		possible = 1
	else:
		possible = 0
	if possible:
		not_peak = 1
		peak = n
		for i in range(1, 2 * k + 1):
			if i % 2 != 0:
				print(not_peak, end=' ')
				not_peak += 1
			else:
				print(peak, end=' ')
				peak -= 1
		for i in range(not_peak, peak + 1):
			print(not_peak, end=' ')
			not_peak += 1
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k:
		print(-1)
		continue
	p = [i + 1 for i in range(n)]
	c = 0
	for i in range(1, n, 2):
		if c == k:
			break
		(p[i], p[i + 1]) = (p[i + 1], p[i])
		c += 1
	print(*p)


t = int(input(''))
while t > 0:
	(n, k) = map(int, input('').split(' '))
	m = (n - 1) // 2
	if n == 0 or n == 1 or n == 2:
		if k == 0:
			ans = [i for i in range(n + 1)]
			print(' '.join(map(str, ans[1:])))
		else:
			print('-1')
	elif m >= k:
		ans = [str(i) for i in range(n + 1)]
		ans = ans[1:]
		itr = 1
		while k:
			(ans[itr], ans[itr + 1]) = (ans[itr + 1], ans[itr])
			k -= 1
			itr = itr + 2
		pt = ' '.join(map(str, ans))
		print(pt)
	else:
		print('-1')
	t = t - 1


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
		continue
	li = [0 for i in range(105)]
	ma = n
	for i in range(1, k + 1):
		li[2 * i] = ma
		ma -= 1
	for i in range(1, n + 1):
		if i <= 2 * k and i % 2 == 0:
			print(li[i], end=' ')
			continue
		print(ma, end=' ')
		ma -= 1
	print('\n')


from math import ceil
for i in range(int(input())):
	(n, k) = map(int, input().split())
	nums = [j for j in range(1, n + 1)]
	ans = []
	m = 0
	if n > 2:
		m = 1
		if n - 3 > 0:
			if (n - 3) % 2 == 0:
				m += (n - 3) // 2
			else:
				m += (n - 4) // 2
	if m >= k or k == 0:
		try:
			for j in range(k):
				ans += [nums.pop(0), nums.pop(-1)]
			ans += sorted(nums, reverse=1)
			print(*ans)
		except:
			print(-1)
	else:
		print(-1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k:
		print(-1)
		continue
	arr = [0 for _ in range(n)]
	num = n
	for j in range(2 * k):
		if j % 2 == 0:
			continue
		arr[j] = num
		num -= 1
	for j in range(len(arr)):
		if arr[j] == 0:
			arr[j] = num
			num -= 1
	for j in range(len(arr)):
		print(arr[j], end=' ')
	print()


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		(n, k) = map(int, input().split())
		if k > (n - 1) // 2:
			print('-1')
		else:
			ara = [0] * n
			take = n
			for i in range(k):
				ara[2 * i + 1] = take
				take -= 1
			for i in range(n):
				if ara[i] == 0:
					ara[i] = take
					take -= 1
			ans = ' '.join(map(str, ara))
			print(ans)
main()


t = int(input())
for i in range(0, t):
	output = ''
	(n, k) = list(map(int, input().split()))
	if n % 2 == 0 and k > n / 2 - 1 or (n % 2 != 0 and k > (n - 1) / 2):
		print('-1')
	else:
		a = 1
		b = 0 + n
		for j in range(0, k):
			output = output + str(a) + ' ' + str(b) + ' '
			a += 1
			b -= 1
		for j in range(k + 1, n - k + 1):
			output = output + str(j) + ' '
		print(output[0:-1])


for t in range(int(input())):
	(n, k) = map(int, input().split())
	temp = 3 + 2 * (k - 1)
	if n < temp:
		print(-1)
	else:
		a = [i for i in range(1, n + 1)]
		i = 1
		while k > 0 and i < n - 1:
			(a[i], a[i + 1]) = (a[i + 1], a[i])
			k -= 1
			i += 2
		print(*a)


import sys
input = sys.stdin.buffer.readline
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rs = lambda : input().decode().rstrip('\n\r')
wrt = sys.stdout.write
fastop = lambda *args, end='\n': wrt(' '.join([str(x) for x in args]) + end)
op = print
xrange = lambda *args: reversed(range(*args))
cdiv = lambda x, y: -(-x // y)
enum = enumerate
inf = float('inf')
mod = 10 ** 9 + 7
from collections import defaultdict as dd, Counter
from heapq import *
from math import gcd
Testcase = ri()
for testcase in range(Testcase):
	(n, k) = rl()
	ck = k
	perm = [-1 for i in range(n)]
	highest = n
	lowest = 1
	for i in range(n):
		if i % 2 and ck:
			perm[i] = highest
			highest -= 1
			ck -= 1
		else:
			perm[i] = lowest
			lowest += 1
	poss = 1
	s = set()
	ck = 0
	for i in perm:
		if i == -1:
			poss = 0
		if i > 0 and i < n - 1 and (perm[i - 1] < perm[i] > perm[i + 1]):
			ck += 1
		if i in s:
			poss = 0
		s.add(i)
	if poss and ck == k:
		print(*perm)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	z = k
	if k > n // 2:
		print(-1)
	else:
		l = []
		l1 = list((i for i in range(1, n + 1)))
		i = 0
		while k > 0:
			k -= 1
			l.append(l1[i])
			l.append(l1[~i])
			i += 1
		j = i
		while i < n - j:
			l.append(l1[i])
			i += 1
		count = 0
		for i in range(1, n - 1):
			if l[i] > l[i - 1] and l[i] > l[i + 1]:
				count += 1
		if count == z:
			print(*(i for i in l))
		else:
			print(-1)


t = int(input())
for i in range(t):
	inp = list(map(int, input().split()))
	n = inp[0]
	k = inp[1]
	val = n
	idx = 0
	res = []
	peak = 0
	l = [i for i in range(1, n + 1)]
	for i in range(n):
		res.append(0)
	if n == k:
		print(-1)
	elif n <= 2 and k > 0:
		print(-1)
	elif k == 0:
		for i in range(1, n + 1):
			print(i, end=' ')
		print()
	elif (n - 2) % 2 == 0:
		if (n - 2) // 2 < k:
			print(-1)
		elif (n - 2) // 2 >= k:
			for i in range(n):
				if i % 2 != 0 and i < n - 1:
					res[i] = val
					l.remove(val)
					val = val - 1
					peak = peak + 1
					if peak == k:
						break
			for i in range(n):
				if i % 2 == 0 or i == n - 1 or res[i] == 0:
					res[i] = l[idx]
					idx = idx + 1
			for item in res:
				print(item, end=' ')
			print()
		else:
			print(-1)
	elif (n - 2) // 2 < k - 1:
		print(-1)
	elif (n - 2) // 2 >= k - 1:
		for i in range(n):
			if i % 2 != 0 and i < n - 1:
				res[i] = val
				l.remove(val)
				val = val - 1
				peak = peak + 1
				if peak == k:
					break
		for i in range(n):
			if i % 2 == 0 or i == n - 1 or res[i] == 0:
				res[i] = l[idx]
				idx = idx + 1
		for item in res:
			print(item, end=' ')
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
	else:
		i = 1
		m = n
		for j in range(n):
			if k == 0:
				break
			print(i, end=' ')
			print(m, end=' ')
			i += 1
			m -= 1
			k -= 1
		for j in range(i, m + 1):
			print(j, end=' ')
		print()


for t in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	arr = [i + 1 for i in range(n)]
	if (n - 1) // 2 < k:
		print(-1)
	else:
		count = 1
		for i in range(k):
			(arr[count], arr[count + 1]) = (arr[count + 1], arr[count])
			count += 2
		for i in arr:
			print(i, end=' ')
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	possible = 1 + (n - 3) // 2
	if k > possible:
		print(-1)
	elif k == 0:
		print(' '.join(map(str, [i + 1 for i in range(n)])))
	else:
		re = 1
		li = [1, 3, 2]
		counter = 4
		while re < k:
			li.append(counter + 1)
			li.append(counter)
			counter += 2
			re += 1
		for iii in range(li[-2] + 1, n + 1):
			li.append(iii)
		print(' '.join(map(str, li)))


T = int(input())
while T > 0:
	(N, K) = map(int, input().split())
	T = T - 1
	A = list(range(1, N + 1))
	if K > (N - 1) / 2:
		print(-1)
	else:
		a = 1
		while K > 0:
			n1 = A[a]
			n2 = A[a + 1]
			A[a] = n2
			A[a + 1] = n1
			a = a + 2
			K = K - 1
		print(*A)


import sys
import math
from collections import defaultdict, Counter, deque
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	ma = n // 2
	if n % 2 == 0:
		ma -= 1
	if k > ma:
		print(-1)
		continue
	ans = [0] * n
	p = n
	for j in range(k):
		ans[2 * j + 1] = p
		p -= 1
	p = 1
	for j in range(n):
		if ans[j] == 0:
			ans[j] = p
			p += 1
	print(*ans)


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


a = int(input())
for i in range(a):
	(n, p) = [int(c) for c in input().split()]
	w = []
	if p * 2 + 1 > n:
		print(-1)
	else:
		for m in range(n - p):
			w.append(m + 1)
			if m < p:
				w.append(n - m)
		print(*w)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(range(1, n + 1))
	test = 0
	if n % 2 == 0:
		x = n // 2 - 1
		if k <= x:
			c = 0
			i = n - 1
			while i > 0 and c < k:
				(a[i], a[i - 1]) = (a[i - 1], a[i])
				i -= 2
				c += 1
		else:
			test = 1
	else:
		x = n // 2
		if k <= x:
			c = 0
			i = n - 1
			while i > 0 and c < k:
				(a[i], a[i - 1]) = (a[i - 1], a[i])
				i -= 2
				c += 1
		else:
			test = 1
	if test:
		print(-1)
	else:
		print(*a)


t = int(input())
for i in range(t):
	arr = input()
	arr = arr.split()
	a = [int(x) for x in arr]
	n = int(arr[0])
	k = int(arr[1])
	if k * 2 + 1 > n:
		print(-1)
		continue
	a = [x for x in range(1, n + 1)]
	if k == 0:
		for j in range(n):
			print(j + 1, end=' ')
		print()
		continue
	s = []
	while a != []:
		s.append(a[0])
		s.append(a[-1])
		a = a[1:-1]
		k -= 1
		if k == 0:
			s.extend(a[::-1])
			break
	for j in s:
		print(j, end=' ')
	print()


import io, os
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	max_peaks = (n - 1) // 2
	if k > max_peaks:
		print(-1)
	else:
		res = [i for i in range(1, n + 1)]
		for j in range(k):
			(a, b) = (2 * j + 1, 2 * j + 2)
			(res[a], res[b]) = (res[b], res[a])
		print(*res)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
	else:
		l = [1]
		j = 3
		c = 0
		while j <= n and c < k:
			l.append(j)
			l.append(j - 1)
			j += 2
			c += 1
		while j <= n:
			l.append(j - 1)
			l.append(j)
			j += 2
		if len(l) < n:
			l.append(n)
		for x in l:
			print(x, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = [i for i in range(1, n + 1)]
	n1 = n
	if n1 % 2 == 1:
		if k > n1 // 2:
			print(-1)
	if n1 % 2 == 0:
		n1 -= 1
		if k > n1 // 2:
			print(-1)
	if k <= n // 2 and k <= n1 // 2:
		peakL = l[n - k:]
		restL = l[:n - k]
		ans = []
		k = 0
		for i in range(len(restL)):
			ans.append(restL[i])
			if k < len(peakL):
				ans.append(peakL[k])
				k += 1
		print(*ans)


nn = int(input())
for _ in range(nn):
	(n, k) = [int(s) for s in input().split()]
	if k > (n - 1) // 2:
		print(-1)
	else:
		res = []
		lo = 1
		hi = n
		for _ in range(k):
			res.append(lo)
			lo += 1
			res.append(hi)
			hi -= 1
		for _ in range(n - 2 * k):
			res.append(hi)
			hi -= 1
		print(' '.join((str(s) for s in res)))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	(l, r) = (2, n)
	if k > (n - 1) // 2:
		print(-1)
	else:
		res = []
		res.append(1)
		while k > 0 and l < r:
			res.append(r)
			res.append(l)
			l += 1
			r -= 1
			k -= 1
		while l <= r:
			res.append(l)
			l += 1
		print(' '.join([str(s) for s in res]))


import sys
for _ in range(int(input())):
	(n, k) = map(int, sys.stdin.readline().split())
	if (n - 1) // 2 >= k:
		res = [0] * n
		for i in range(k):
			res[2 * i + 1] = n - i
		i = 1
		j = 0
		while i < n - k + 1:
			if res[j] == 0:
				res[j] = i
				i += 1
			j += 1
		print(*res)
	else:
		print(-1)


t = int(input())

def solve():
	(n, k) = map(int, input().split())
	if n == 1 and n == k:
		print(-1)
		return
	low = 2
	high = n
	arr = [1]
	for i in range(k):
		if low >= high:
			print('-1')
			return
		arr.append(high)
		arr.append(low)
		low += 1
		high -= 1
	for i in range(low, high + 1):
		arr.append(i)
	print(*arr)
for i in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = []
	for i in range(1, n + 1):
		a.append(i)
	if k == 0:
		for i in a:
			print(i, end=' ')
		print()
	elif k >= n // 2 and n % 2 == 0 or (k > n // 2 and n % 2 != 0):
		print(-1)
	else:
		for i in range(1, k * 2 + 1):
			if a[i] % 2 == 0:
				a[i] = a[i] + 1
			else:
				a[i] = a[i] - 1
		for i in a:
			print(i, end=' ')
		print()


def helper(n, k):
	if k > (n - 1) // 2:
		return []
	res = [0] * n
	for i in range(k):
		res[i * 2 + 1] = n - i
	curr = 1
	for i in range(n):
		if res[i] == 0:
			res[i] = curr
			curr += 1
	return res
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split(' '))
	res = helper(n, k)
	if not res:
		print('-1')
	else:
		print(' '.join(map(str, res)))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

def llinp():
	return list(map(int, input().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
for __ in range(iinp()):
	(n, k) = nninp()
	if n == 1 or n == 2:
		if k == 0:
			print(*list(range(1, n + 1)))
		else:
			print(-1)
	else:
		curr = 2
		ans = list(range(1, n + 1))
		for i in range(k):
			(ans[curr], ans[curr - 1]) = (ans[curr - 1], ans[curr])
			curr += 2
			k -= 1
			if curr >= n:
				break
		if k == 0:
			print(*ans)
		else:
			print(-1)


import math
from collections import defaultdict
from sys import stdout
DEBUG = True

def log(*args, **kwargs):
	if DEBUG:
		print(*args, **kwargs)

def ri():
	return int(input())

def rl(f=int):
	return list(map(f, input().split()))

def rs():
	return input()

class Solution:

	def __init__(self):
		pass

	def run(self):
		(n, k) = rl()
		if n % 2 == 0 and k > (n - 2) // 2 or (n % 2 == 1 and k > (n - 2 + 1) // 2):
			return -1
		result = [0] * n
		i = 1
		current = n
		while k > 0:
			result[i] = current
			i += 2
			current -= 1
			k -= 1
		current = 1
		for i in range(n):
			if result[i] == 0:
				result[i] = current
				current += 1
		return ' '.join(map(str, result))
t = int(input())
s = Solution()
for i in range(t):
	print(s.run())


t = int(input())
while t:
	(a, b) = map(int, input().split())
	x = list(range(1, a + 1))
	temp = b
	if b and a >= 3:
		x = x[1:] + [x[0]]
		b = b - 1
	m = len(x) - 2
	flag = 0
	for i in range(m - 1, 1, -2):
		if not b:
			flag = 1
			break
		temp = x[i]
		x[i] = x[i - 1]
		x[i - 1] = temp
		b = b - 1
	if not b:
		print(*x)
		t = t - 1
		continue
	print('-1')
	t = t - 1


test_count = int(input())
for _ in range(test_count):
	(n, k) = [int(x) for x in input().split()]
	max_k = (n - 1) // 2
	if k > max_k:
		print('-1')
		continue
	arr = list(range(1, n + 1))
	for i in range(k):
		arr[2 * i + 1] = 2 * i + 3
		arr[2 * i + 2] = 2 * i + 2
	print(' '.join([str(x) for x in arr]))


N = int(input())
for x in range(N):
	init = input().split()
	n = int(init[0])
	k = int(init[1])
	final = []
	no = 0
	if n % 2 == 0:
		n1 = list(range(1, int((n + 2) / 2)))
		n2 = list(range(int((n + 2) / 2), n + 1))
	else:
		n1 = list(range(1, int((n + 3) / 2)))
		n2 = list(range(int((n + 3) / 2), n + 1))
	if n == 1 and k == 0:
		print('1')
		continue
	if n % 2 == 0 and k > n / 2 - 1 or (n % 2 != 0 and k > (n - 1) / 2):
		no = 1
	else:
		final.append(n1[0])
		del n1[0]
		for i in range(k):
			final.append(n2[0])
			del n2[0]
			final.append(n1[0])
			del n1[0]
		for y in n1 + n2:
			final.append(y)
	if no == 1:
		print('-1')
	else:
		print(' '.join(list(map(str, final))))


from collections import Counter, deque, defaultdict
from itertools import accumulate, product, groupby
import operator
import math
from functools import reduce

def solve():
	(n, k) = map(int, input().split())
	if k == 0:
		return list(range(1, n + 1))
	if n <= 2:
		maxPeaks = 0
	else:
		maxPeaks = (n - 1) // 2
	if k > maxPeaks:
		return [-1]
	q = deque([i for i in range(1, n + 1)])
	ans = []
	for i in range(k):
		ans.append(q.popleft())
		ans.append(q.pop())
	while q:
		ans.append(q.popleft())
	return ans
for _ in range(int(input())):
	print(*solve())


for i in range(int(input())):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print('-1')
	else:
		l2 = n
		l1 = 2
		a = [1]
		for j in range(k):
			a.append(l2)
			a.append(l1)
			l1 = l1 + 1
			l2 = l2 - 1
		for j in range(l1, l2 + 1):
			a.append(j)
		print(' '.join(map(str, a)))


for s in [*open(0)][1:]:
	(n, k) = map(int, s.split())
	a = [*range(1, n + 1)]
	i = 1
	while i < min(n - 1, 2 * k):
		(a[i], a[i + 1]) = (a[i + 1], a[i])
		i += 2
	print(*(a, [-1])[i < 2 * k])


r = int(input())
for i in range(r):
	(n, k) = list(map(lambda x: int(x), input().split(' ')))
	if k >= int((n + 1) / 2):
		print(-1)
	else:
		print(1, end='')
		for j in range(1, k + 1):
			print(f' {2 * j + 1} {2 * j}', end='')
		for j in range(2 * k + 2, n + 1):
			print(f' {j}', end='')
		print()


import math
import random
from collections import *
mod = 1000000007
r1 = lambda : int(input())
rm = lambda : map(int, input().split())
rms = lambda : map(str, input().split())
rls = lambda : list(rm())

def solve():
	test = r1()
	while test:
		test -= 1
		(n, k) = rm()
		if (n - 1) // 2 >= k:
			ls = [0] * n
			i = 0
			c = 0
			x = 0
			while i < n:
				if i % 2 and c < k:
					c += 1
				else:
					ls[i] = x + 1
					x += 1
				i += 1
			i = 1
			while k:
				k -= 1
				ls[i] = n
				i += 2
				n -= 1
			print(*ls)
		else:
			print(-1)

def def_value():
	return 'nan'
solve()


for _ in range(int(input())):
	(n, k) = list(map(int, input().split(' ')))
	if k > (n - 1) // 2:
		print(-1)
	else:
		sol = []
		(a, b) = (1, n)
		for i in range(n):
			if i % 2 and k > 0:
				sol.append(b)
				b -= 1
				k -= 1
			else:
				sol.append(a)
				a += 1
		print(*sol)


t = int(input())

def f(x):
	y = x.split(' ')
	for i in range(len(y)):
		y[i] = int(y[i])
	n = y[0]
	k = y[-1]
	if n % 2 == 0:
		if k >= n / 2:
			return [-1]
		else:
			l = []
			i = 0
			while i < n:
				j = i + 1
				l = l + [j]
				i += 1
			I = 0
			i = 1
			while I < k:
				(l[i], l[i + 1]) = (l[i + 1], l[i])
				i += 2
				I += 1
			return l
	elif k > n // 2:
		return [-1]
	else:
		L = []
		i = 0
		while i < n:
			j = i + 1
			L = L + [j]
			i += 1
		I = 0
		i = 1
		while I < k:
			(L[i], L[i + 1]) = (L[i + 1], L[i])
			i += 2
			I += 1
		return L

def g(x):
	i = 0
	s = ''
	for i in range(len(x)):
		s += str(x[i]) + ' '
	return s
lines = ''
ans = ''
for i in range(t):
	x = input()
	lines += x + '\n'
	ans += g(f(x)) + '\n'
print(ans)


from math import ceil
for ii in range(int(input())):
	(a, b) = map(int, input().split())
	c = ceil(a / 2) - 1
	if b > c:
		print(-1)
	else:
		print(1, end=' ')
		for jj in range(1, a, 2):
			if b:
				print(jj + 2, jj + 1, end=' ')
				b -= 1
			elif jj + 2 <= a:
				print(jj + 1, jj + 2, end=' ')
			else:
				print(jj + 1, end=' ')
		print()


for i in ' ' * int(input()):
	(a, b) = list(map(int, input().split()))
	if b > (a - 1) // 2:
		print('-1')
	else:
		print(*((c // 2 + b + 1 if c % 2 == 0 else c // 2 + 1) if c in range(1, b * 2 + 2) else c for c in range(1, a + 1)))


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


t = int(input())
for j in range(t):
	(m, n) = map(int, input().split())
	h = n
	x = [0] * m
	if m > 2:
		if m % 2 == 1:
			if n > m // 2:
				print(-1)
			else:
				i = 1
				p = m
				while n > 0:
					x[i] = p
					p -= 1
					n -= 1
					i += 2
				for i in range(0, m):
					if x[i] == 0:
						x[i] = p
						p -= 1
				d = 0
				for y in range(1, m - 1):
					if x[y] > x[y + 1] and x[y] > x[y - 1]:
						d += 1
				if d == h:
					print(*x)
				else:
					print(-2)
		elif n > (m - 1) // 2:
			print(-1)
		else:
			i = 1
			p = m
			while n > 0:
				x[i] = p
				p -= 1
				n -= 1
				i += 2
			for i in range(0, m):
				if x[i] == 0:
					x[i] = p
					p -= 1
			d = 0
			for y in range(1, m - 1):
				if x[y] > x[y + 1] and x[y] > x[y - 1]:
					d += 1
			if d == h:
				print(*x)
			else:
				print(-1)
	elif m == 1:
		if n == 0:
			print(1)
		else:
			print(-1)
	elif n == 0:
		print(1, 2)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if k == 0:
		print(' '.join(map(str, range(1, n + 1))))
	elif k > n // 2:
		print(-1)
	else:
		valid = True
		ans = [0] * n
		i = n - k + 1
		x = 1
		while i <= n and x <= len(ans):
			ans[x] = i
			if x == len(ans) - 1:
				valid = False
				break
			i += 1
			x += 2
		if not valid:
			print(-1)
			continue
		i = 1
		for x in range(len(ans)):
			if ans[x] == 0:
				ans[x] = i
				i += 1
		print(' '.join(map(str, ans)))


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if k <= (n - 2) // 2 + (n - 2) % 2:
		l = 0
		i = 2
		print(1, end=' ')
		while l != k:
			l += 1
			print(i + 1, i, end=' ')
			i += 2
		while i != n + 1:
			print(i, end=' ')
			i += 1
		print()
	else:
		print(-1)


t = int(input())
for r in range(t):
	(n, k) = map(int, input().split())
	if n < 2 * k + 1:
		print(-1)
	else:
		l = []
		p = n
		q = 1
		for i in range(n):
			if (i + 1) % 2 == 0 and (i + 1) // 2 <= k:
				l.append(p)
				p -= 1
			else:
				l.append(q)
				q += 1
		s = ''
		for a in range(n):
			s = s + str(l[a]) + ' '
		print(s)


class Solve:

	def __init__(self):
		pass

	def _solve(self):
		(n, k) = map(int, input().split())
		perm = [str(i + 1) for i in range(n)]
		for i in range(1, n - 1):
			if i & 1 and k:
				(perm[i], perm[i + 1]) = (perm[i + 1], perm[i])
				k -= 1
		if k:
			print(-1)
		else:
			print(' '.join(perm))

	def _reset(self):
		pass

	def solve(self):
		t = int(input())
		for i in range(t):
			self._solve()
			self._reset()
Solve().solve()


for i in range(int(input())):
	(a, b) = map(int, input().split())
	x = []
	if b == 0:
		for j in range(1, a + 1):
			x.append(j)
	elif b >= a / 2:
		x.append(-1)
	elif a % 2 == 0:
		count = 0
		cnt = 1
		for j in range(int(a / 2), 0, -1):
			x.append(j)
		for j in range(a, a - b, -1):
			x.insert(cnt, j)
			cnt += 2
			count += 1
		for j in range(a // 2 + 1, a - b + 1):
			x.append(j)
	else:
		cnt = 1
		count = 0
		for j in range(a // 2, 0, -1):
			x.append(j)
		for j in range(a, a - b, -1):
			x.insert(cnt, j)
			cnt += 2
			count += 1
		for j in range(a // 2 + 1, a - b + 1):
			x.append(j)
	y = []
	for _ in x:
		y.append(str(_))
	print(' '.join(y))


parm = []
t = int(input())
for i in range(t):
	(n, k) = input().split()
	parm.append((int(n), int(k)))
for i in range(t):
	(n, k) = parm[i]
	A = [x for x in range(1, n + 1)]
	if k > (n - 1) // 2:
		print(-1)
	elif k == 0:
		print(*A)
	else:
		for j in range(k):
			(A[2 * j + 1], A[2 * j + 2]) = (A[2 * j + 2], A[2 * j + 1])
		print(*A)


t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	lst = [i for i in range(1, n + 1)]
	if n % 2 == 0:
		if n // 2 - 1 >= k:
			count = 0
			for i in range(1, n, 2):
				if count == k:
					break
				if i + 1 < n:
					(lst[i], lst[i + 1]) = (lst[i + 1], lst[i])
					count += 1
			print(*lst)
		else:
			print(-1)
	elif n // 2 >= k:
		count = 0
		for i in range(1, n, 2):
			if count == k:
				break
			if i + 1 < n:
				(lst[i], lst[i + 1]) = (lst[i + 1], lst[i])
				count += 1
		print(*lst)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k:
		print(-1)
		continue
	res = [i for i in range(1, n + 1)]
	i = 0
	while i < k:
		(res[2 * i + 2], res[2 * i + 1]) = (res[2 * i + 1], res[2 * i + 2])
		i += 1
	print(*res)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k == 0:
		print(*range(1, n + 1))
		continue
	if k <= (n - 1) // 2:
		a = [1] * n
		c = 0
		x = 2
		f = 0
		for i in range(2, n):
			if i % 2 == 0 and c < k:
				a[i] = x
				x += 1
				c += 1
			elif c >= k:
				f = i
				break
		c = 0
		if f > 0:
			for i in range(f, n):
				a[i] = x
				x += 1
		for i in range(n):
			if i % 2 and c < k:
				a[i] = x
				x += 1
				c += 1
			elif c >= k:
				break
		print(*a)
	else:
		print(-1)


t = int(input())
for inh in range(0, t):
	(n, k) = map(int, input().split())
	if n == 1:
		if k == 0:
			print(1)
		else:
			print(-1)
	elif n == 2:
		if k == 0:
			print(1, 2)
		else:
			print(-1)
	else:
		if n % 2 == 0:
			peaks = int(n // 2) - 1
		else:
			peaks = int(n // 2)
		if peaks >= k:
			start = 1
			end = n
			c = 0
			ans = []
			while True:
				if c < k:
					ans.append(start)
					ans.append(end)
					c += 1
					start += 1
					end -= 1
				else:
					ans.append(end)
					end -= 1
				if start == end:
					ans.append(start)
					break
			print(*ans)
		else:
			print(-1)


t = int(input())
while t > 0:
	t = t - 1
	(r, x) = [int(r) for r in input().split()]
	lt = []
	if x == 0:
		for ii in range(1, r + 1):
			lt.append(ii)
		print(*lt)
	elif r % x == 0 and r // x == 2:
		print(-1)
	elif r // 2 >= x:
		for i in range(1, r + 1 - x):
			lt.append(i)
		for j in range(1, x + 1):
			lt.insert(2 * j - 1, r - j + 1)
		print(*lt)
	else:
		print(-1)


import math

def getint():
	return [int(i) for i in input().split()]

def solve():
	(n, k) = getint()
	if n % 2 and n // 2 < k:
		print(-1)
		return
	if n % 2 == 0 and n // 2 - 1 < k:
		print(-1)
		return
	x = 1
	y = n
	ans = []
	for i in range(k):
		ans.extend([x, y])
		x += 1
		y -= 1
	res = [i for i in range(x, y + 1)]
	ans.extend(res)
	print(*ans)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	arr = []
	(n, k) = map(int, input().split())
	if 2 * k < n:
		(i, j, peaks) = (1, n, 0)
		while n and peaks < k:
			if len(arr) % 2 == 0:
				arr.append(i)
				i += 1
			elif len(arr) % 2 != 0:
				arr.append(j)
				j -= 1
				peaks += 1
			n -= 1
		for x in range(i, j + 1):
			arr.append(x)
		print(*arr)
	else:
		print('-1')


import sys
input = sys.stdin.readline

def solve():
	(n, k) = map(int, input().split())
	if n == 1:
		return [-1] if k == 1 else [1]
	v = n // 2
	if n % 2 == 0:
		v -= 1
	if k > v:
		return [-1]
	ans = [i for i in range(1, n + 1)]
	for i in range(n - 2, 0, -2):
		if k == 0:
			break
		(ans[i], ans[i + 1]) = (ans[i + 1], ans[i])
		k -= 1
	return ans
for _ in range(int(input())):
	print(*solve())


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k >= (n + 1) // 2:
		print(-1)
	else:
		a = list(range(1, n + 1))
		for i in range(k):
			(a[1 + 2 * i], a[2 + 2 * i]) = (a[2 + 2 * i], a[1 + 2 * i])
		print(*a)


from collections import defaultdict, OrderedDict, Counter
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from queue import Queue, PriorityQueue
from heapq import *
from statistics import *
from math import *
import fractions
import copy
from copy import deepcopy
import sys
import io
sys.setrecursionlimit(10000)
import math
import os
import bisect
import collections
mod = pow(10, 9) + 7
import random
from random import *
from time import time

def ncr(n, r, p=mod):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def normalncr(n, r):
	r = min(r, n - r)
	count = 1
	for i in range(n - r, n + 1):
		count *= i
	for i in range(1, r + 1):
		count //= i
	return count
inf = float('inf')
adj = defaultdict(set)
visited = defaultdict(int)

def addedge(a, b):
	adj[a].add(b)
	adj[b].add(a)

def bfs(v):
	q = Queue()
	q.put(v)
	visited[v] = 1
	while q.qsize() > 0:
		s = q.get_nowait()
		print(s)
		for i in adj[s]:
			if visited[i] == 0:
				q.put(i)
				visited[i] = 1

def dfs(v, visited):
	if visited[v] == 1:
		return
	visited[v] = 1
	print(v)
	for i in adj[v]:
		dfs(i, visited)

def reverse_bisect_right(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x > a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def reverse_bisect_left(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x >= a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def get_list():
	return list(map(int, input().split()))

def get_str_list_in_int():
	return [int(i) for i in list(input())]

def get_str_list():
	return list(input())

def get_map():
	return map(int, input().split())

def input_int():
	return int(input())

def matrix(a, b):
	return [[0 for i in range(b)] for j in range(a)]

def swap(a, b):
	return (b, a)

def find_gcd(l):
	a = l[0]
	for i in range(len(l)):
		a = gcd(a, l[i])
	return a

def is_prime(n):
	sqrta = int(sqrt(n))
	for i in range(2, sqrta + 1):
		if n % i == 0:
			return 0
	return 1

def prime_factors(n):
	while n % 2 == 0:
		return [2] + prime_factors(n // 2)
	sqrta = int(sqrt(n))
	for i in range(3, sqrta + 1, 2):
		if n % i == 0:
			return [i] + prime_factors(n // i)
	return [n]

def p(a):
	if type(a) == str:
		print(a + '\n')
	else:
		print(str(a) + '\n')

def ps(a):
	if type(a) == str:
		print(a)
	else:
		print(str(a))

def kth_no_not_div_by_n(n, k):
	return k + (k - 1) // (n - 1)

def forward_array(l):
	n = len(l)
	stack = []
	forward = [0] * n
	for i in range(len(l) - 1, -1, -1):
		while len(stack) and l[stack[-1]] < l[i]:
			stack.pop()
		if len(stack) == 0:
			forward[i] = len(l)
		else:
			forward[i] = stack[-1]
		stack.append(i)
	return forward

def backward_array(l):
	n = len(l)
	stack = []
	backward = [0] * n
	for i in range(len(l)):
		while len(stack) and l[stack[-1]] < l[i]:
			stack.pop()
		if len(stack) == 0:
			backward[i] = -1
		else:
			backward[i] = stack[-1]
		stack.append(i)
	return backward
nc = 'NO'
yc = 'YES'
ns = 'No'
ys = 'Yes'

def make_permutation(c):
	s = set([i for i in range(1, n + 1)])
	for i in c:
		if i in s:
			s.remove(i)
	s = list(s)
	for i in s:
		c.append(i)
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = [i for i in range(1, n + 1)]
	b = a[::-1]
	c = []
	for i in range(2 * k):
		if i % 2 == 0:
			c.append(a[i // 2])
		else:
			c.append(b[i // 2])
	make_permutation(c)
	if n % 2 == 0:
		if k <= n // 2 - 1:
			print(*c)
		else:
			print(-1)
	elif k <= n // 2:
		print(*c)
	else:
		print(-1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = [0] * (n + 1)
	num = n
	for i in range(2, n, 2):
		if k == 0:
			break
		arr[i] = num
		num -= 1
		k -= 1
	if k != 0:
		print(-1)
		continue
	cur = 1
	for i in range(1, n + 1):
		if arr[i] == 0:
			arr[i] = cur
			cur += 1
	for i in range(1, n + 1):
		print(arr[i], end=' ')
	print()


def solve(n, k):
	if k == 0:
		print(*range(1, n + 1))
	elif k == 1 and n == 2:
		print(-1)
	elif k == n:
		print(-1)
	elif k >= (n + 1) // 2:
		print(-1)
	else:
		ans = [0 for i in range(n)]
		i = 1
		c = 0
		d = n
		while i < n - 1 and c < k:
			ans[i] = d
			i += 2
			c += 1
			d -= 1
		for i in range(n):
			if ans[i] == 0:
				ans[i] = d
				d -= 1
		print(*ans)
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	solve(n, k)


import sys
import bisect
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
gp = []
cost = []
dp = []
mx = []

def dfs(root, par):
	global gp, cost, dp
	dp[root] = cost[root]
	for i in gp[root]:
		if i == par:
			continue
		dfs(i, root)
		dp[root] = max(dp[root], dp[i])

def hnbhai():
	(n, k) = sd()
	ans = [-1] * n
	abe = n
	x = k
	for i in range(1, n - 1, 2):
		if x == 0:
			break
		ans[i] = abe
		abe -= 1
		x -= 1
	if x > 0:
		print(-1)
		return
	for i in range(n):
		if ans[i] == -1:
			ans[i] = abe
			abe -= 1
	print(*ans)
for _ in range(sb()):
	hnbhai()


tc = int(input())
for _ in range(tc):
	(n, k) = list(map(int, input().split()))
	if k <= (n - 1) // 2:
		l = []
		for ei in range(1, n + 1):
			l.append(ei)
		(c, i) = (0, 1)
		while c < k and i < n:
			(l[i], l[i + 1]) = (l[i + 1], l[i])
			c += 1
			i += 2
		print(*l)
	else:
		print(-1)


for tt in range(int(input())):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k or (n <= 2 and k):
		print(-1)
		continue
	if k == 0:
		print(*[i for i in range(1, n + 1)])
		continue
	ans = [-1] * n
	ans[0] = 1
	for i in range(k):
		lc = i * 2 + 1
		ans[lc] = lc + 2
		ans[lc + 1] = lc + 1
	for i in range(n):
		if ans[i] == -1:
			for j in range(1, n + 1):
				if j not in ans:
					ans[i] = j
					break
	print(*ans)


from queue import Queue
from itertools import accumulate
from io import BytesIO, IOBase
from itertools import combinations
import threading
from collections import deque
from functools import reduce, cmp_to_key
import sys
from math import sqrt
import heapq
import random
import math
from collections import defaultdict
from collections import Counter
import io
import os
import bisect
from fractions import Fraction

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def swap(arr, a, b):
	(arr[a], arr[b]) = (arr[b], arr[a])
t = iinput()
for _ in range(t):
	(n, k) = rinput()
	if k == 0:
		print(*[i for i in range(1, n + 1)])
		continue
	maxval = int(math.ceil((n - 2) / 2.0))
	if maxval < k or n == 2 or n == 1:
		print(-1)
		continue
	val = n
	moves = k
	arr = [1]
	temp = 2
	while moves:
		arr.append(val)
		arr.append(temp)
		temp += 1
		val -= 1
		moves -= 1
	for i in range(temp, n - k + 1):
		arr.append(i)
	print(*arr)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if (a - 1) / 2 >= b:
		i = 1
		while True:
			if i >= a + 1:
				break
			if i == 1:
				print(1, end=' ')
				i += 1
			elif b > 0:
				print(i + 1, i, end=' ')
				b -= 1
				i += 2
			else:
				print(i, end=' ')
				i += 1
		print()
	else:
		print('-1')


a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]

def f(n, k):
	m = n
	p = 1
	if n == 1 and k == 0:
		print(1)
	elif (n == 1 or n == 2) and k > 0:
		print(-1)
	elif n == 2 and k == 0:
		print(1, 2)
	elif n >= 3:
		if n % 2 == 0 and k > n // 2 - 1:
			print(-1)
		elif n % 2 != 0 and k > n // 2:
			print(-1)
		else:
			b = a[:n - k]
			for i in range(k):
				b.insert(p, m)
				p += 2
				m -= 1
			print(*b, sep=' ')
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	f(n, k)


test_cases = int(input())

def fun():
	l = input().split(' ')
	n = int(l[0])
	k = int(l[1])
	if n // 2 < k:
		return -1
	if n % 2 == 0:
		if n // 2 == k:
			return -1
	lis = []
	for i in range(n):
		lis.append(i + 1)
	for x in range(k):
		lis.remove(n - x)
		lis.insert(2 * x + 1, n - x)
	new_lis = []
	for h in lis:
		new_lis.append(str(h))
	return ' '.join(new_lis)
output = []
for m in range(test_cases):
	output.append(fun())
for a in output:
	print(a)


from os import path
import sys, time
from math import ceil, floor, gcd, log, log2, factorial
from collections import defaultdict, Counter, OrderedDict, deque
from heapq import heapify, heappush, heappop
from bisect import *
from operator import mul
(maxx, mod) = (float('inf'), int(1000000000.0 + 7))
(localsys, start_time) = (0, time.time())
if path.exists('input.txt'):
	localsys = 1
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n < 3 and k > 0:
		print(-1)
		continue
	if k == 0:
		print(*list(range(1, n + 1)))
		continue
	x = (n - 3) // 2 + 1
	if k > x:
		print(-1)
		continue
	ans = []
	i = 1
	j = n
	cnt = 0
	el = 3 + (k - 1) * 2
	for t in range(n):
		if cnt < el:
			if cnt % 2 == 0:
				ans.append(i)
				i += 1
			else:
				ans.append(j)
				j -= 1
		else:
			ans.append(i)
			i += 1
		cnt += 1
	print(*ans)
if localsys:
	print('\n\n\nTime Elased :', time.time() - start_time, 'seconds')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = [i for i in range(1, n + 1)]
	if k == 0:
		print(*l)
		continue
	p = [l.pop(0)]
	c = 0
	(i, j) = (0, n)
	while len(l) >= 2:
		a = l.pop()
		b = l.pop(0)
		p.append(a)
		p.append(b)
		c += 1
		if c == k:
			break
	if c == k:
		d = p + l
		print(*d)
	else:
		print(-1)


t = int(input())
for i in range(0, t):
	arr = list(map(int, input().strip().split()))
	n = arr[0]
	k = arr[1]
	temp = [0 for i in range(n)]
	a = [i + 1 for i in range(n)]
	l = 0
	if n > 2 * k:
		for j in range(0, n):
			if k != 0:
				if j % 2 == 0:
					m = min(a)
					temp[j] = m
					a.remove(m)
				else:
					k = k - 1
					m = max(a)
					temp[j] = m
					a.remove(m)
			else:
				a.sort()
				temp[j] = a[l]
				l += 1
		print(*temp, sep=' ')
	else:
		print(-1)


T_ON = 1
DEBUG_ON = 0
MOD = 998244353

def solve():
	(n, k) = read_ints()
	if k > (n - 1) // 2:
		print(-1)
		return
	A = []
	for i in range(k):
		A.append(i + 1)
		A.append(n - i)
	A += list(range(k + 1, k + 1 + n - 2 * k))
	print_nums(A)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import *
from random import *
input = stdin.readline
prin = stdout.write
from random import sample
from collections import Counter, deque
from fractions import *
from math import sqrt, ceil, log2, gcd, cos, pi
mod = 10 ** 9 + 7

def f(arr, i, j, d, dist):
	if i == j:
		return
	nn = max(arr[i:j])
	for tl in range(i, j):
		if arr[tl] == nn:
			dist[tl] = d
			f(arr, i, tl, d + 1, dist)
			f(arr, tl + 1, j, d + 1, dist)

def ps(n):
	cp = 0
	lk = 0
	arr = {}
	while n % 2 == 0:
		n = n // 2
		lk += 1
	for ps in range(3, ceil(sqrt(n)) + 1, 2):
		lk = 0
		cc = 0
		while n % ps == 0:
			n = n // ps
			lk += 1
	if n != 1:
		lk += 1
		return False
	return True

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def factorials(n, r):
	slr = n
	dpr = r
	qlr = 1
	qs = 1
	mod = 10 ** 9 + 7
	for ip in range(n - r + 1, n + 1):
		qlr = qlr * ip % mod
	for ij in range(1, r + 1):
		qs = qs * ij % mod
	ans = qlr * modInverse(qs) % mod
	return ans

def modInverse(b):
	qr = 10 ** 9 + 7
	return pow(b, qr - 2, qr)
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def power(arr):
	listrep = arr
	subsets = []
	for i in range(2 ** len(listrep)):
		subset = []
		for k in range(len(listrep)):
			if i & 1 << k:
				subset.append(listrep[k])
		subsets.append(subset)
	return subsets

def pda(n):
	list = []
	su = 0
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				list.append(i)
				su += i
			else:
				list.append(n // i)
				list.append(i)
				su += i
				su += n // i
	return su

def dis(xa, ya, xb, yb):
	return sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

def ii():
	return int(input())

def ilist():
	return [int(x) for x in input().strip().split()]

def islist():
	return list(map(str, input().split().rstrip()))

def inp():
	return input().strip()

def google(test, ans):
	return 'Case #' + str(test) + ': ' + str(ans)

def overlap(x1, y1, x2, y2):
	if x2 > y1:
		return y1 - x2
	if y1 > y2:
		return y2 - x2
	return y1 - x2

def dist(x1, y1, x2, y2):
	return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
t = int(input())
for p in range(t):
	(n, k) = ilist()
	peak = ceil(n / 2) - 1
	if k > peak:
		print(-1)
		continue
	maxx = n
	ans = [0] * n
	i = 1
	while k > 0:
		ans[i] = maxx
		i += 2
		k -= 1
		maxx -= 1
	mi = 1
	for i in range(n):
		if ans[i] == 0:
			ans[i] = mi
			mi += 1
	print(*ans)


for testis in range(int(input())):
	(n, k) = map(int, input().split())
	nn = n
	if nn < 3:
		pos = 0
	else:
		nn = nn - 3
		pos = 1
		pos = pos + nn // 2
	if pos < k:
		print(-1)
	else:
		a = [i + 1 for i in range(n)]
		ans = []
		while k:
			b = a.pop(0)
			e = a.pop()
			ans.append(b)
			ans.append(e)
			k = k - 1
		while a:
			x = a.pop()
			ans.append(x)
		print(*ans)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	a = [i for i in range(1, n + 1)]
	ct = 0
	for i in range(2, n):
		if ct < k:
			if a[i - 2] < a[i - 1] and a[i - 1] < a[i]:
				(a[i - 1], a[i]) = (a[i], a[i - 1])
				ct += 1
		if ct == k:
			break
	if ct != k:
		print(-1)
	else:
		for i in a:
			print(i, end=' ')
		print('')
	t -= 1


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	if 2 * k >= n:
		print(-1)
		continue
	arr = []
	count = 1
	for i in range(1, n - k + 1, 1):
		if count % 2 == 0 and k != 0:
			arr.append(n)
			n -= 1
			k -= 1
			count += 1
		arr.append(i)
		count += 1
	print(*arr)


for u in range(int(input())):
	(n, k) = map(int, input().split())
	x = 0
	if n % 2 == 0:
		x = n // 2 - 1
	else:
		x = n // 2
	if k > x:
		print(-1)
	else:
		l = list(range(1, n + 1))
		for i in range(2, n, 2):
			if k > 0:
				(l[i], l[i - 1]) = (l[i - 1], l[i])
				k -= 1
			else:
				break
		print(*l)


import math
t = int(input())
T = []
for i in range(t):
	line = input()
	lineSplit = line.split()
	n = int(lineSplit[0])
	k = int(lineSplit[1])
	a = [l + 1 for l in range(n)]
	if k == 0:
		T.append(a)
	elif k <= math.floor((n - 1) / 2):
		for j in range(k):
			a.insert(2 * j + 1, a[n - 1])
			a.pop()
		T.append(a)
	else:
		T.append([-1])
for i in range(t):
	Output = ' '.join([str(m) for m in T[i]])
	print(Output)


import math
t = int(input())
for asdfasfd in range(0, t):
	(n, a) = map(int, input().split())
	perm = [x for x in range(1, n + 1)]
	if a > math.ceil(n / 2) - 1:
		print('-1')
	else:
		for i in range(0, a):
			tmp = perm[-1 - 2 * i]
			perm[-1 - 2 * i] = perm[-1 - (2 * i + 1)]
			perm[-1 - (2 * i + 1)] = tmp
		print(' '.join((str(x) for x in perm)))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
from itertools import accumulate as ac
mod = int(1000000000.0) + 7
mod = 998244353
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	(n, k) = inp()
	ct = 0
	stk = k
	for i in range(1, n, 2):
		ct += 1
	if ct >= k:
		temp = [i for i in range(1, n + 1)]
		ans = [None] * n
		for i in range(1, n, 2):
			if k > 0:
				k -= 1
				ans[i] = temp.pop()
		for i in range(n):
			if ans[i] == None:
				ans[i] = temp.pop()
		ele = 0
		for i in range(n):
			if i == 0 or i == n - 1:
				pass
			elif ans[i] > ans[i - 1] and ans[i] > ans[i + 1]:
				ele += 1
		if ele == stk:
			print(*ans)
		else:
			print(-1)
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k:
		print(-1)
		continue
	a = []
	c = 1
	for i in range(n):
		if i % 2:
			a += [n - c + 1]
			c += 1
		else:
			a += [c]
		if 2 * k == i:
			break
	o = c + 1
	while o <= n - c + 1:
		a += [o]
		o += 1
	print(*a)


def solve(n, k):
	if n <= 2 and k > 0:
		return []
	if 2 * k >= n:
		return []
	ret = [0] * n
	curNum = n
	i = 1
	biggest = n
	for qwe in range(k):
		ret[i] = biggest
		i += 2
		biggest -= 1
	num = 1
	for i in range(len(ret)):
		if ret[i] == 0:
			ret[i] = num
			num += 1
	return ret
t = int(input())
for qwe in range(t):
	(n, k) = map(int, input().split(' '))
	ret = solve(n, k)
	if len(ret) == 0:
		print('-1')
	else:
		print(' '.join(map(str, ret)))


from sys import *
from collections import defaultdict as dd
from math import *
from bisect import *

def sinp():
	return input()

def inp():
	return int(sinp())

def minp():
	return map(int, sinp().split())

def linp():
	return list(minp())

def strl():
	return list(sinp())

def pr(x):
	print(x)
mod = int(1000000000.0 + 7)
for _ in range(inp()):
	(n, k) = minp()
	if 2 * k + 1 > n:
		pr(-1)
	else:
		l = []
		m = n - (2 * k + 1) - 1
		a = k + 1
		b = a + 1
		for i in range(a):
			l.extend([a, b])
			a -= 1
			b += 1
		if m == -1:
			print(*l[:-1])
		else:
			l.extend([i for i in range(b, b + m)])
			print(*l)


t = int(input(''))
for i in range(t):
	(n, k) = map(int, input('').split())
	dem1 = 1
	dem2 = 2
	dem3 = n
	v = []
	for i in range(k):
		v.append(dem1)
		if len(v) == n:
			continue
		v.append(dem3)
		if len(v) == n:
			continue
		dem1 += 1
		dem3 -= 1
		if dem3 < dem1:
			break
	for j in range(dem1, dem3 + 1):
		v.append(j)
	if len(v) != n:
		print(-1)
	else:
		print(' '.join(map(str, v)))


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	l = []
	k = 0
	d = a - b
	f = a
	if a / 2 <= b:
		print(-1)
	else:
		for j in range(1, a - b + 1):
			l.append(j)
		while len(l) < f:
			l.insert(1 + k, a)
			k = k + 2
			a = a - 1
		print(*l)


from sys import stdin
from heapq import heappush, heappop, heapify, heappushpop
lines = stdin.read().splitlines()
li = -1

def inp():
	global li
	li += 1
	return lines[li]

def inpint():
	global li
	li += 1
	return int(lines[li])

def inpints(change=0):
	global li
	li += 1
	return [int(i) + change for i in lines[li].split()]

def inpfloat():
	global li
	li += 1
	return float(lines[li])

def inpfloats(change=0):
	global li
	li += 1
	return [float(i) + change for i in lines[li].split()]
t = inpint()
for T in range(t):
	(n, k) = inpints()
	if k > n // 2 or (n % 2 == 0 and k >= n // 2):
		print(-1)
		continue
	arr = []
	for i in range(k):
		arr.append(i)
		arr.append(n - i - 1)
	for i in range(k, n - k):
		arr.append(i)
	print(*[i + 1 for i in arr])


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	if 2 * k + 1 > n:
		print(-1)
	else:
		A = []
		val = 2 * k + 1
		v1 = val
		for i in range(k):
			A.append(i + 1)
			A.append(val)
			val = val - 1
		A.append(k + 1)
		for i in range(v1, n):
			A.append(i + 1)
		print(*A)


for _ in range(int(input())):
	(n, k) = map(int, input().split(' '))
	l = []
	for i in range(1, n + 1):
		l.append(i)
	if n == k or k >= n - k:
		print(-1)
	else:
		a = []
		for i in range(k):
			a.append(i + 1)
			a.append(n - i)
		a.extend(range(k + 1, n - k + 1))
		print(*a)


import math
T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	answer = [0] * n
	peak_val = n - k + 1
	norm_val = 1
	if math.ceil(n / 2) - 1 < k:
		print(-1)
	else:
		for i in range(k):
			answer[2 * i + 1] = peak_val
			peak_val += 1
		for i in range(n):
			if answer[i] == 0:
				answer[i] = norm_val
				norm_val += 1
		final_answer = ''
		for element in answer:
			final_answer += str(element) + ' '
		print(final_answer)


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	if k > (n - 1) // 2:
		print(-1)
	else:
		d = []
		for i in range(1, k * 2 + 2):
			if i % 2 == 1:
				d.append(i // 2 + 1)
			else:
				d.append(k * 2 + 2 - i // 2)
		for i in range(k * 2 + 2, n + 1):
			d.append(i)
		print(*d)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = []
	count = 0
	j = 0
	if k == 0:
		for aa in range(1, n + 1):
			print(aa, end=' ')
		print()
	else:
		for i in range(1, n + 1):
			if j == 2:
				count += 1
				j = 0
			arr.append(count)
			j += 1
		if arr[n - 1] >= k:
			arrr = [1]
			l = 1
			p = 3
			q = 2
			while l < n:
				for s in range(p, n + 1, 2):
					arrr.append(s)
					p = s + 2
					break
				for ss in range(q, n + 1, 2):
					arrr.append(ss)
					q += 2
					break
				l += 2
			sss = 0
			x = 0
			y = 0
			for kk in range(1, n - 1):
				if arrr[kk] > arrr[kk - 1] and arrr[kk] > arrr[kk + 1]:
					sss += 1
					if k == sss:
						x = arrr[kk + 1] + 1
						y = kk + 1
						break
			jj = []
			for hh in range(y + 1):
				jj.append(arrr[hh])
			for g in range(x + 1, n + 1):
				jj.append(g)
			print(*jj)
		else:
			print(-1)


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


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if (n < 3 or n <= 2 * k) and k > 0:
		print(-1, end=' ')
		print()
		continue
	elif k == 0:
		for i in range(1, n + 1):
			print(i, end=' ')
		print()
		continue
	print(1, end=' ')
	a = list(range(2, n + 1))
	for i in range(2, n + 1):
		if k > 0 and i % 2 == 0:
			print(a[-1], end=' ')
			k -= 1
			a.pop()
		elif k > 0 and i % 2 == 1:
			print(a[0], end=' ')
			a.pop(0)
		elif k == 0:
			print(a[-1], end=' ')
			a.pop()
	print()


for i in range(int(input())):
	(x, y) = list(map(int, input().split()))
	if y > (x - 1) // 2:
		print('-1')
	else:
		print(*((z // 2 + y + 1 if z % 2 == 0 else z // 2 + 1) if z in range(1, y * 2 + 2) else z for z in range(1, x + 1)))


from collections import Counter
from re import X
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ans = [0] * (n + 1)
	x = n
	for i in range(2, n, 2):
		if k == 0:
			break
		ans[i] = x
		x -= 1
		k -= 1
	if k:
		print(-1)
		continue
	y = 1
	for i in range(1, n + 1):
		if ans[i] == 0:
			ans[i] = y
			y += 1
	print(*ans[1:])


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	maxpeak = (n - 1) // 2
	if k > maxpeak:
		print(-1)
		continue
	s = 1
	e = n
	lim = k * 2 + 1
	for i in range(1, lim):
		if i % 2 == 0:
			print(e, end=' ')
			e -= 1
		else:
			print(s, end=' ')
			s += 1
	for i in range(s, e + 1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [i + 1 for i in range(n)]
	sol = 0
	if n % 2 == 0:
		sol = n // 2 - 1
	else:
		sol = n // 2
	ind = 0
	f = 1
	if k == 0:
		f = 0
	if sol >= k:
		for i in range(n):
			if i % 2 == 0 or f == 0:
				print(a[ind], end=' ')
				ind += 1
			else:
				print(a[n - ind], end=' ')
				k = k - 1
				if k == 0:
					f = 0
		print()
	else:
		print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
	else:
		ans = [i + 1 for i in range(n)]
		for i in range(1, n - 1, 2):
			if not k:
				break
			(ans[i], ans[i + 1]) = (ans[i + 1], ans[i])
			k -= 1
		print(*ans)


for t in range(int(input())):
	(N, k) = map(int, input().split())
	if k * 2 + 1 <= N:
		L = list(range(1, N + 1))
		L1 = L[:N // 2 + 1]
		L2 = list(L[N // 2 + 1:N])
		o = []
		for i in range(k):
			o.append(L1.pop(0))
			o.append(L2.pop(0))
		if len(L1) != 0:
			o.extend(L1)
		else:
			o.extend(list(reversed(L2)))
		if len(L2) != 0 and len(L1) != 0:
			o.extend(L2)
		elif len(L2) != 0 and len(L1) == 0:
			pass
		elif len(L2) == 0:
			pass
		print(*o)
	else:
		print(-1)


import sys, math
inf = float('inf')
input = sys.stdin.readline

def lcm(a, b):
	return int(a / math.gcd(a, b) * b)

def gcd(a, b):
	return int(math.gcd(a, b))

def checkpeak(arr):
	c = 0
	for i in range(1, len(arr) - 1):
		if arr[i] == 0:
			return c
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			c += 1
	return c
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n == 1:
		if k == 1:
			print(-1)
		else:
			print(1)
	else:
		ans = [0] * n
		avail = [i for i in range(1, n + 1)]
		peakCount = 0
		for i in range(n):
			if i % 2 == 0:
				ans[i] = avail.pop(0)
			elif checkpeak(ans) < k:
				ans[i] = avail.pop()
			else:
				ans[i] = avail.pop(0)
		if checkpeak(ans) == k:
			print(*ans)
		else:
			print(-1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	array = []
	if not n / 2 > k:
		print(-1)
	elif k == 0:
		for i in range(1, n + 1):
			array.append(i)
		print(*array)
	else:
		for i in range(1, n + 1):
			array.append(i)
		for i in range(0, 2 * k, 2):
			(array[i + 1], array[i + 2]) = (array[i + 2], array[i + 1])
		print(*array)


import math
n = int(input())
for i in range(n):
	a = list(map(int, input().strip().split()))
	if 2 * a[1] < a[0]:
		l = []
		t = []
		c = 0
		for i in range(1, a[0] - a[1] + 1):
			l.append(i)
		for j in range(a[0] - a[1] + 1, a[0] + 1):
			t.append(j)
		for i in range(0, len(t)):
			l.insert(i + i + 1, t[i])
		for i in range(1, len(l) - 1):
			if l[i - 1] < l[i] and l[i + 1] < l[i]:
				c += 1
		if c == a[1]:
			print(*l)
		else:
			print(-1)
	else:
		print(-1)


import sys
n_list = []
k_list = []
idx = 0
t = 0
for line in sys.stdin:
	items = line.split()
	if idx == 0:
		t = int(items[0])
		idx = 1
		continue
	n_list.append(int(items[0]))
	k_list.append(int(items[1]))
	idx += 1
	if idx > t:
		break
for i in range(t):
	n = n_list[i]
	k = k_list[i]
	if (n - 1) / 2 < k:
		print('-1')
		continue
	print_string = ''
	start = 1
	end = n
	for i in range(k):
		print_string += str(start) + ' ' + str(end) + ' '
		start += 1
		end -= 1
	for i in range(end - start + 1):
		print_string += str(start) + ' '
		start += 1
	print(print_string)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	big = (n + 1) // 2 - 1
	if k > big:
		print(-1)
		continue
	p = [i + 1 for i in range(n)]
	for i in range(k):
		(p[2 * (i + 1)], p[2 * (i + 1) - 1]) = (p[2 * (i + 1) - 1], p[2 * (i + 1)])
	p = [str(x) for x in p]
	print(' '.join(p))


def divisors(M):
	d = []
	i = 1
	while M >= i ** 2:
		if M % i == 0:
			d.append(i)
			if i ** 2 != M:
				d.append(M // i)
		i = i + 1
	return d

def popcount(x):
	x = x - (x >> 1 & 1431655765)
	x = (x & 858993459) + (x >> 2 & 858993459)
	x = x + (x >> 4) & 252645135
	x = x + (x >> 8)
	x = x + (x >> 16)
	return x & 127

def eratosthenes(n):
	res = [0 for i in range(n + 1)]
	prime = set([])
	for i in range(2, n + 1):
		if not res[i]:
			prime.add(i)
			for j in range(1, n // i + 1):
				res[i * j] = 1
	return prime

def factorization(n):
	res = []
	for p in prime:
		if n % p == 0:
			while n % p == 0:
				n //= p
			res.append(p)
	if n != 1:
		res.append(n)
	return res

def euler_phi(n):
	res = n
	for x in range(2, n + 1):
		if x ** 2 > n:
			break
		if n % x == 0:
			res = res // x * (x - 1)
			while n % x == 0:
				n //= x
	if n != 1:
		res = res // n * (n - 1)
	return res

def ind(b, n):
	res = 0
	while n % b == 0:
		res += 1
		n //= b
	return res

def isPrimeMR(n):
	if n == 1:
		return 0
	d = n - 1
	d = d // (d & -d)
	L = [2, 3, 5, 7, 11, 13, 17]
	for a in L:
		t = d
		y = pow(a, t, n)
		if y == 1:
			continue
		while y != n - 1:
			y = y * y % n
			if y == 1 or t == n - 1:
				return 0
			t <<= 1
	return 1

def findFactorRho(n):
	from math import gcd
	m = 1 << n.bit_length() // 8
	for c in range(1, 99):
		f = lambda x: (x * x + c) % n
		(y, r, q, g) = (2, 1, 1, 1)
		while g == 1:
			x = y
			for i in range(r):
				y = f(y)
			k = 0
			while k < r and g == 1:
				ys = y
				for i in range(min(m, r - k)):
					y = f(y)
					q = q * abs(x - y) % n
				g = gcd(q, n)
				k += m
			r <<= 1
		if g == n:
			g = 1
			while g == 1:
				ys = f(ys)
				g = gcd(abs(x - ys), n)
		if g < n:
			if isPrimeMR(g):
				return g
			elif isPrimeMR(n // g):
				return n // g
			return findFactorRho(g)

def primeFactor(n):
	i = 2
	ret = {}
	rhoFlg = 0
	while i * i <= n:
		k = 0
		while n % i == 0:
			n //= i
			k += 1
		if k:
			ret[i] = k
		i += 1 + i % 2
		if i == 101 and n >= 2 ** 20:
			while n > 1:
				if isPrimeMR(n):
					(ret[n], n) = (1, 1)
				else:
					rhoFlg = 1
					j = findFactorRho(n)
					k = 0
					while n % j == 0:
						n //= j
						k += 1
					ret[j] = k
	if n > 1:
		ret[n] = 1
	if rhoFlg:
		ret = {x: ret[x] for x in sorted(ret)}
	return ret

def divisors(n):
	res = [1]
	prime = primeFactor(n)
	for p in prime:
		newres = []
		for d in res:
			for j in range(prime[p] + 1):
				newres.append(d * p ** j)
		res = newres
	res.sort()
	return res

def xorfactorial(num):
	if num == 0:
		return 0
	elif num == 1:
		return 1
	elif num == 2:
		return 3
	elif num == 3:
		return 0
	else:
		x = baseorder(num)
		return 2 ** x * ((num - 2 ** x + 1) % 2) + function(num - 2 ** x)

def xorconv(n, X, Y):
	if n == 0:
		res = [X[0] * Y[0] % mod]
		return res
	x = [X[i] + X[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	y = [Y[i] + Y[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	z = [X[i] - X[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	w = [Y[i] - Y[i + 2 ** (n - 1)] for i in range(2 ** (n - 1))]
	res1 = xorconv(n - 1, x, y)
	res2 = xorconv(n - 1, z, w)
	former = [(res1[i] + res2[i]) * inv for i in range(2 ** (n - 1))]
	latter = [(res1[i] - res2[i]) * inv for i in range(2 ** (n - 1))]
	former = list(map(lambda x: x % mod, former))
	latter = list(map(lambda x: x % mod, latter))
	return former + latter

def merge_sort(A, B):
	(pos_A, pos_B) = (0, 0)
	(n, m) = (len(A), len(B))
	res = []
	while pos_A < n and pos_B < m:
		(a, b) = (A[pos_A], B[pos_B])
		if a < b:
			res.append(a)
			pos_A += 1
		else:
			res.append(b)
			pos_B += 1
	res += A[pos_A:]
	res += B[pos_B:]
	return res

class UnionFindVerSize:

	def __init__(self, N):
		self._parent = [n for n in range(0, N)]
		self._size = [1] * N
		self.group = N

	def find_root(self, x):
		if self._parent[x] == x:
			return x
		self._parent[x] = self.find_root(self._parent[x])
		stack = [x]
		while self._parent[stack[-1]] != stack[-1]:
			stack.append(self._parent[stack[-1]])
		for v in stack:
			self._parent[v] = stack[-1]
		return self._parent[x]

	def unite(self, x, y):
		gx = self.find_root(x)
		gy = self.find_root(y)
		if gx == gy:
			return
		self.group -= 1
		if self._size[gx] < self._size[gy]:
			self._parent[gx] = gy
			self._size[gy] += self._size[gx]
		else:
			self._parent[gy] = gx
			self._size[gx] += self._size[gy]

	def get_size(self, x):
		return self._size[self.find_root(x)]

	def is_same_group(self, x, y):
		return self.find_root(x) == self.find_root(y)

class WeightedUnionFind:

	def __init__(self, N):
		self.parent = [i for i in range(N)]
		self.size = [1 for i in range(N)]
		self.val = [0 for i in range(N)]
		self.flag = True
		self.edge = [[] for i in range(N)]

	def dfs(self, v, pv):
		stack = [(v, pv)]
		new_parent = self.parent[pv]
		while stack:
			(v, pv) = stack.pop()
			self.parent[v] = new_parent
			for (nv, w) in self.edge[v]:
				if nv != pv:
					self.val[nv] = self.val[v] + w
					stack.append((nv, v))

	def unite(self, x, y, w):
		if not self.flag:
			return
		if self.parent[x] == self.parent[y]:
			self.flag = self.val[x] - self.val[y] == w
			return
		if self.size[self.parent[x]] > self.size[self.parent[y]]:
			self.edge[x].append((y, -w))
			self.edge[y].append((x, w))
			self.size[x] += self.size[y]
			self.val[y] = self.val[x] - w
			self.dfs(y, x)
		else:
			self.edge[x].append((y, -w))
			self.edge[y].append((x, w))
			self.size[y] += self.size[x]
			self.val[x] = self.val[y] + w
			self.dfs(x, y)

class Dijkstra:

	class Edge:

		def __init__(self, _to, _cost):
			self.to = _to
			self.cost = _cost

	def __init__(self, V):
		self.G = [[] for i in range(V)]
		self._E = 0
		self._V = V

	@property
	def E(self):
		return self._E

	@property
	def V(self):
		return self._V

	def add_edge(self, _from, _to, _cost):
		self.G[_from].append(self.Edge(_to, _cost))
		self._E += 1

	def shortest_path(self, s):
		import heapq
		que = []
		d = [10 ** 15] * self.V
		d[s] = 0
		heapq.heappush(que, (0, s))
		while len(que) != 0:
			(cost, v) = heapq.heappop(que)
			if d[v] < cost:
				continue
			for i in range(len(self.G[v])):
				e = self.G[v][i]
				if d[e.to] > d[v] + e.cost:
					d[e.to] = d[v] + e.cost
					heapq.heappush(que, (d[e.to], e.to))
		return d

def Z_algorithm(s):
	N = len(s)
	Z_alg = [0] * N
	Z_alg[0] = N
	i = 1
	j = 0
	while i < N:
		while i + j < N and s[j] == s[i + j]:
			j += 1
		Z_alg[i] = j
		if j == 0:
			i += 1
			continue
		k = 1
		while i + k < N and k + Z_alg[k] < j:
			Z_alg[i + k] = Z_alg[k]
			k += 1
		i += k
		j -= k
	return Z_alg

class BIT:

	def __init__(self, n, mod=0):
		self.BIT = [0] * (n + 1)
		self.num = n
		self.mod = mod

	def query(self, idx):
		res_sum = 0
		mod = self.mod
		while idx > 0:
			res_sum += self.BIT[idx]
			if mod:
				res_sum %= mod
			idx -= idx & -idx
		return res_sum

	def update(self, idx, x):
		mod = self.mod
		while idx <= self.num:
			self.BIT[idx] += x
			if mod:
				self.BIT[idx] %= mod
			idx += idx & -idx
		return

class dancinglink:

	def __init__(self, n, debug=False):
		self.n = n
		self.debug = debug
		self._left = [i - 1 for i in range(n)]
		self._right = [i + 1 for i in range(n)]
		self.exist = [True for i in range(n)]

	def pop(self, k):
		if self.debug:
			assert self.exist[k]
		L = self._left[k]
		R = self._right[k]
		if L != -1:
			if R != self.n:
				(self._right[L], self._left[R]) = (R, L)
			else:
				self._right[L] = self.n
		elif R != self.n:
			self._left[R] = -1
		self.exist[k] = False

	def left(self, idx, k=1):
		if self.debug:
			assert self.exist[idx]
		res = idx
		while k:
			res = self._left[res]
			if res == -1:
				break
			k -= 1
		return res

	def right(self, idx, k=1):
		if self.debug:
			assert self.exist[idx]
		res = idx
		while k:
			res = self._right[res]
			if res == self.n:
				break
			k -= 1
		return res

class SparseTable:

	def __init__(self, A, merge_func, ide_ele):
		N = len(A)
		n = N.bit_length()
		self.table = [[ide_ele for i in range(n)] for i in range(N)]
		self.merge_func = merge_func
		for i in range(N):
			self.table[i][0] = A[i]
		for j in range(1, n):
			for i in range(0, N - 2 ** j + 1):
				f = self.table[i][j - 1]
				s = self.table[i + 2 ** (j - 1)][j - 1]
				self.table[i][j] = self.merge_func(f, s)

	def query(self, s, t):
		b = t - s + 1
		m = b.bit_length() - 1
		return self.merge_func(self.table[s][m], self.table[t - 2 ** m + 1][m])

class BinaryTrie:

	class node:

		def __init__(self, val):
			self.left = None
			self.right = None
			self.max = val

	def __init__(self):
		self.root = self.node(-10 ** 15)

	def append(self, key, val):
		pos = self.root
		for i in range(29, -1, -1):
			pos.max = max(pos.max, val)
			if key >> i & 1:
				if pos.right is None:
					pos.right = self.node(val)
					pos = pos.right
				else:
					pos = pos.right
			elif pos.left is None:
				pos.left = self.node(val)
				pos = pos.left
			else:
				pos = pos.left
		pos.max = max(pos.max, val)

	def search(self, M, xor):
		res = -10 ** 15
		pos = self.root
		for i in range(29, -1, -1):
			if pos is None:
				break
			if M >> i & 1:
				if xor >> i & 1:
					if pos.right:
						res = max(res, pos.right.max)
					pos = pos.left
				else:
					if pos.left:
						res = max(res, pos.left.max)
					pos = pos.right
			elif xor >> i & 1:
				pos = pos.right
			else:
				pos = pos.left
		if pos:
			res = max(res, pos.max)
		return res

def solveequation(edge, ans, n, m):
	x = [0] * m
	used = [False] * n
	for v in range(n):
		if used[v]:
			continue
		y = dfs(v)
		if y != 0:
			return False
	return x

	def dfs(v):
		used[v] = True
		r = ans[v]
		for (to, dire, id) in edge[v]:
			if used[to]:
				continue
			y = dfs(to)
			if dire == -1:
				x[id] = y
			else:
				x[id] = -y
			r += y
		return r

class Matrix:
	mod = 10 ** 9 + 7

	def set_mod(m):
		Matrix.mod = m

	def __init__(self, L):
		self.row = len(L)
		self.column = len(L[0])
		self._matrix = L
		for i in range(self.row):
			for j in range(self.column):
				self._matrix[i][j] %= Matrix.mod

	def __getitem__(self, item):
		if type(item) == int:
			raise IndexError('you must specific row and column')
		elif len(item) != 2:
			raise IndexError('you must specific row and column')
		(i, j) = item
		return self._matrix[i][j]

	def __setitem__(self, item, val):
		if type(item) == int:
			raise IndexError('you must specific row and column')
		elif len(item) != 2:
			raise IndexError('you must specific row and column')
		(i, j) = item
		self._matrix[i][j] = val

	def __add__(self, other):
		if (self.row, self.column) != (other.row, other.column):
			raise SizeError('sizes of matrixes are different')
		res = [[0 for j in range(self.column)] for i in range(self.row)]
		for i in range(self.row):
			for j in range(self.column):
				res[i][j] = self._matrix[i][j] + other._matrix[i][j]
				res[i][j] %= Matrix.mod
		return Matrix(res)

	def __sub__(self, other):
		if (self.row, self.column) != (other.row, other.column):
			raise SizeError('sizes of matrixes are different')
		res = [[0 for j in range(self.column)] for i in range(self.row)]
		for i in range(self.row):
			for j in range(self.column):
				res[i][j] = self._matrix[i][j] - other._matrix[i][j]
				res[i][j] %= Matrix.mod
		return Matrix(res)

	def __mul__(self, other):
		if type(other) != int:
			if self.column != other.row:
				raise SizeError('sizes of matrixes are different')
			res = [[0 for j in range(other.column)] for i in range(self.row)]
			for i in range(self.row):
				for j in range(other.column):
					temp = 0
					for k in range(self.column):
						temp += self._matrix[i][k] * other._matrix[k][j]
					res[i][j] = temp % Matrix.mod
			return Matrix(res)
		else:
			n = other
			res = [[n * self._matrix[i][j] % Matrix.mod for j in range(self.column)] for i in range(self.row)]
			return Matrix(res)

	def __pow__(self, m):
		if self.column != self.row:
			raise MatrixPowError('the size of row must be the same as that of column')
		n = self.row
		res = Matrix([[int(i == j) for i in range(n)] for j in range(n)])
		while m:
			if m % 2 == 1:
				res = res * self
			self = self * self
			m //= 2
		return res

	def __str__(self):
		res = []
		for i in range(self.row):
			for j in range(self.column):
				res.append(str(self._matrix[i][j]))
				res.append(' ')
			res.append('\n')
		res = res[:len(res) - 1]
		return ''.join(res)
import sys, random, bisect
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import permutations
from math import gcd, log
input = lambda : sys.stdin.readline().rstrip()
mi = lambda : map(int, input().split())
li = lambda : list(mi())
res = []
for _ in range(int(input())):
	(n, k) = mi()
	if k == 0:
		res.append([i + 1 for i in range(n)])
		continue
	if k + k + 1 <= n:
		_ans = [i + 1 for i in range(n - k, n)]
		gomi = [n - k + 1 - i for i in range(1, k + 2)]
		ans = []
		for i in range(k):
			ans.append(gomi[i])
			ans.append(_ans[i])
		ans.append(gomi[-1])
		ans = [i + 1 for i in range(n - 2 * k - 1)] + ans
		res.append(ans)
	else:
		res.append([-1])
for ans in res:
	print(*ans)


def nk():
	pass
t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	l = []
	for i in range(n):
		l.append(i + 1)
	i = 1
	while k > 0 and i < n:
		if i + 1 < n:
			(l[i], l[i + 1]) = (l[i + 1], l[i])
			k -= 1
		i += 2
	if k == 0:
		print(*l)
	else:
		print(-1)


for s in [*open(0)][1:]:
	(n, k) = map(int, s.split())
	if k > (n - 1) // 2:
		print(-1)
		continue
	l = [1]
	m = 1
	for i in range(2, 2 * k + 2):
		l += [i - 2 * (i & 1) + 1]
		m = max(m, l[-1])
	l += [*range(m + 1, n + 1)]
	print(*l)


def Solve():
	(n, k) = map(int, input().split())
	a = [-1 for i in range(n)]
	a[0] = 1
	t = n
	g = 2
	i = 1
	while i < n - 1:
		if k > 0:
			(a[i], a[i + 1]) = (t, g)
			t -= 1
			g += 1
			k -= 1
			i += 2
		else:
			a[i] = g
			g += 1
			i += 1
	a[-1] = t
	if k == 0:
		for x in a:
			print(x, end=' ')
		print()
	else:
		print(-1)
q = int(input())
while q:
	Solve()
	q -= 1


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if n % 2 == 0 and k > n // 2 - 1 or (n % 2 != 0 and k > n // 2):
		print(-1)
	else:
		a = [1]
		p = 0
		for j in range(1, n):
			if p < k:
				if j % 2 != 0:
					a.append(j + 2)
					p += 0.5
				else:
					a.append(j)
					p += 0.5
			else:
				a.append(max(a) + 1)
		for x in a:
			print(x, end=' ')


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	splt = n // 2
	flag = False
	if n % 2 == 0:
		if k >= splt:
			print(-1)
			flag = True
	elif k > splt:
		print(-1)
		flag = True
	if flag != True:
		main = list(range(1, n + 1))
		new = []
		left = main[:n - k]
		right = main[n - k:]
		i = 0
		while i < len(left) and i < len(right):
			new.append(left[i])
			new.append(right[i])
			i += 1
		while i < len(left):
			new.append(left[i])
			i += 1
		k = ''
		for i in new:
			k += str(i) + ' '
		k = k[:-1]
		print(k)


import sys
input = sys.stdin.readline
for test in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	if k * 2 >= n:
		print(-1)
		continue
	ans = [i for i in range(1, n + 1)]
	count = 1
	for i in range(k):
		(ans[count], ans[count + 1]) = (ans[count + 1], ans[count])
		count += 2
	print(*ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = [i for i in range(1, n + 1)]
	if (n - 1) // 2 < k or (n <= 2 and k > 0):
		print(-1)
	else:
		i = 1
		c = 0
		while c < k and i + 1 < n:
			(l[i], l[i + 1]) = (l[i + 1], l[i])
			c = c + 1
			i = i + 2
		c = 0
		for i in range(1, n - 1):
			if l[i] > l[i - 1] and l[i] > l[i + 1]:
				c = c + 1
		if c == k:
			print(*l)
		else:
			print(-1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if n < 3 and k == 0:
		print(' '.join(map(str, [i for i in range(1, n + 1)])))
	elif n < 3:
		print(-1)
	elif n % 2 == 0 and k <= n // 2 - 1:
		ans = [i for i in range(n + 1)]
		count = 0
		if k > 0:
			for i in range(2, n):
				if i % 2 == 0:
					ans[i] += 1
				else:
					ans[i] -= 1
				count += 1
				if count == k * 2:
					break
		print(*ans[1:])
	elif n % 2 == 0:
		print(-1)
	elif n % 2 == 1 and k <= n // 2:
		ans = [i for i in range(n + 1)]
		count = 0
		if k > 0:
			for i in range(2, n + 1):
				if i % 2 == 0:
					ans[i] += 1
				else:
					ans[i] -= 1
				count += 1
				if count == k * 2:
					break
		print(*ans[1:])
	else:
		print(-1)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if n <= 2 * k:
		ans = -1
		print(ans)
	else:
		ans = [i for i in range(1, n + 1)]
		for i in range(k):
			(ans[-(2 * i + 1)], ans[-(2 * i + 2)]) = (ans[-(2 * i + 2)], ans[-(2 * i + 1)])
		print(*ans)


from sys import stdin
input = stdin.readline
rn = lambda : int(input())
rns = lambda : map(int, input().split())
rl = lambda : list(map(int, input().split()))
rs = lambda : input()
YN = lambda x: print('YES') if x else print('NO')
mod = 10 ** 9 + 7
from math import ceil
for _ in range(rn()):
	(n, k) = rns()
	if k == 0:
		print(*list(range(1, n + 1)))
	elif k > ceil((n - 2) / 2):
		print(-1)
	else:
		ans = n * [0]
		i = 1
		for j in range(k):
			ans[i] = n - j
			i += 2
		i = 1
		for j in range(n):
			if ans[j] == 0:
				ans[j] = i
				i += 1
		print(*ans)


def solve(N, K):
	if not 0 <= K <= (N - 1) // 2:
		return -1
	ans = [0] * N
	can = [i + 1 for i in range(N)]
	for i in range(K):
		val = can.pop()
		ans[i * 2 + 1] = val
	for i in range(N):
		if ans[i] == 0:
			ans[i] = can.pop()
	return ' '.join(map(str, ans))
T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	print(solve(N, K))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k == 0:
		ans = [i for i in range(1, n + 1)]
		print(*ans)
	elif n == 1:
		if k == 0:
			print(1)
		else:
			print(-1)
	elif n % 2 == 0 and k >= n // 2 or (n % 2 == 1 and k > n // 2) or n == 2:
		print(-1)
	else:
		ans = [0] * n
		t = n
		for i in range(1, n, 2):
			if k:
				ans[i] = t
				t -= 1
				k -= 1
			else:
				break
		for i in range(n):
			if ans[i] == 0:
				ans[i] = t
				t -= 1
		print(*ans)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	t = 0
	if n % 2 == 0:
		t = math.floor((n - 1) / 2)
	else:
		t = math.floor(n / 2)
	if k > t or (n <= 2 and k != 0):
		print('-1')
	else:
		newlist = [x for x in range(1, n + 1)]
		temp = 0
		for i in range(1, n):
			if i % 2 == 0 and k != 0:
				temp = newlist[i - 1]
				newlist[i - 1] = newlist[i]
				newlist[i] = temp
				k -= 1
		print(*newlist)


def peakarr(n, k):
	if n % 2 == 1:
		if k > n // 2:
			print('-1')
			return 0
	elif k > n / 2 - 1:
		print('-1')
		return 0
	arr = [i for i in range(1, n + 1, 1)]
	for i in range(k):
		temp = arr[2 * i + 1]
		arr[2 * i + 1] = arr[2 * i + 2]
		arr[2 * i + 2] = temp
	for i in range(n):
		print(arr[i], end=' ')
	print('')
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	peakarr(n, k)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if k > (n - 1) // 2:
		print(-1)
	else:
		x = 1
		cnt = 0
		for i in range(n, n - k, -1):
			print(x, end=' ')
			print(i, end=' ')
			x += 1
			cnt += 2
		for i in range(n - cnt):
			print(x, end=' ')
			x += 1
		print()


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	l = []
	for i in range(n):
		l.append(i + 1)
	if k == 0:
		print(*l)
		continue
	if k >= n / 2:
		print('-1')
		continue
	j = 1
	for i in range(k):
		temp = l[j]
		l[j] = l[j + 1]
		l[j + 1] = temp
		j += 2
	print(*l)


t = int(input())

def makeit(k, n):
	L = [i + 1 for i in range(n)]
	j = 1
	while j < n - 1 and k > 0:
		L[j] = j + 2
		L[j + 1] = j + 1
		j += 2
		k = k - 1
	if k == 0:
		return L
	else:
		return -1
for loop in range(t):
	(n, k) = [int(x) for x in input().split()]
	if makeit(k, n) == -1:
		print(-1)
	else:
		c = makeit(k, n)
		for i in c:
			print(i, end=' ')
		print()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	arr = []
	if k > (n - 1) // 2:
		print(-1)
	else:
		for i in range(k):
			arr.append(i + 1)
			arr.append(n - i)
	arr.extend(list(range(k + 1, n - k + 1)))
	print(*arr)


def arr_p(n, k):
	num = (n - 1) // 2
	if k > num:
		return -1
	arr = []
	if k == 0:
		arr = [i for i in range(1, n + 1)]
		return arr
	for i in range(1, n // 2 + 2):
		arr.append(i)
	j = arr[-1] + 1
	i = 1
	while k > 0:
		arr.insert(i, j)
		i += 2
		j += 1
		k -= 1
	if j not in arr:
		for i in range(j, n + 1):
			arr.append(i)
	return arr
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	res = arr_p(n, k)
	if res == -1:
		print(res)
	else:
		print(*res, sep=' ')


import sys
import math
LI = lambda : [int(k) for k in input().split()]
input = lambda : sys.stdin.readline().rstrip()
IN = lambda : int(input())
S = lambda : input()
for i in range(IN()):
	(n, k) = LI()
	if k > (n - 1) // 2:
		print(-1)
		continue
	else:
		dig = 1
		las = n
		for i in range(n):
			if i % 2 == 1 and k > 0:
				print(las, end=' ')
				las -= 1
				k -= 1
			else:
				print(dig, end=' ')
				dig += 1
		print()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	if (n - 1) // 2 < k:
		print(-1)
		continue
	a = [0] * n
	for i in range(k):
		a[2 * i + 1] = n - i
	i = 1
	for j in range(n):
		if a[j] == 0:
			a[j] = i
			i += 1
	print(*a)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if n % 2 == 1:
		mp = n // 2
	else:
		mp = n // 2 - 1
	if k > mp:
		print(-1)
	else:
		i = 1
		j = n
		ans = []
		while k > 0:
			ans.append(i)
			i = i + 1
			ans.append(j)
			j = j - 1
			k = k - 1
		while len(ans) < n:
			ans.append(i)
			i = i + 1
		print(*ans)


t = int(input())
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	if k == 0:
		ans = []
		for i in range(1, n + 1):
			ans.append(i)
		print(*ans)
	elif k > n - 2:
		print(-1)
	else:
		ans = [0] * n
		if n % 2 == 0:
			check = n // 2 - 1
		else:
			check = n // 2
		if k > check:
			print(-1)
		else:
			i = 1
			end = n
			while k:
				k = k - 1
				ans[i] = end
				end -= 1
				i += 2
			start = 1
			for i in range(0, n):
				if ans[i] == 0:
					ans[i] = start
					start += 1
			print(*ans)


for _ in range(int(input())):
	(n, p) = map(int, input().split())
	if n <= 2 and p > 0:
		print(-1)
	elif n % 2 == 0 and p > (n - 2) // 2:
		print(-1)
	elif n % 2 != 0 and p > (n - 1) // 2:
		print(-1)
	elif p == 0:
		print(*[x for x in range(1, n + 1)])
	else:
		L = [x for x in range(1, n + 1)]
		k = 1
		while k < n - 1:
			(L[k], L[k + 1]) = (L[k + 1], L[k])
			k += 2
			p -= 1
			if p == 0:
				break
		if p > 0:
			print(-1)
		else:
			print(*L)


def arrIn():
	return list(map(int, input().split()))

def mapIn():
	return map(int, input().split())

def check_palindrome(s):
	n = len(s)
	for i in range(n):
		if s[i] != s[n - i - 1]:
			return False
	return True
for ii in range(int(input())):
	(n, p) = mapIn()
	x = n // 2
	x = n // 2
	if n % 2 == 0:
		x -= 1
	if p > x:
		print(-1)
	else:
		a = [0] * n
		c = 0
		x = n
		if p != 0:
			for i in range(1, n, 2):
				a[i] = x
				x -= 1
				c += 1
				if c == p:
					break
		y = 1
		for i in range(n):
			if a[i] == 0:
				a[i] = y
				y += 1
		for i in range(n):
			print(a[i], end=' ')
		print()


for u in range(int(input())):
	(a, b) = map(int, input().split())
	if b == 0:
		x = [i for i in range(1, a + 1)]
		print(*x)
	elif b > (a - 1) // 2:
		print(-1)
	else:
		x = [i for i in range(1, a + 1)]
		n = 0
		i = 1
		j = 2
		while i < len(x) - 1 and n < b:
			(x[i], x[i + 1]) = (x[i + 1], x[i])
			n += 1
			i += 2
		print(*x)


for _ in range(int(input())):
	(n, k) = (int(i) for i in input().split())
	if k > (n + 1) // 2 - 1:
		print('-1')
		continue
	perm = list(range(1, n + 1))
	for i in range(1, k + 1):
		x = 2 * i - 1
		y = x + 1
		(perm[x], perm[y]) = (perm[y], perm[x])
	print(' '.join(map(str, perm)))


test_case = int(input())
for i in range(test_case):
	values = list(map(int, input().split()))
	n = values[0]
	k = values[1]
	arr = [0] * n
	if k == 0:
		for j in range(n):
			arr[j] = j + 1
		for j in range(n):
			print(arr[j], end=' ')
			print()
		continue
	if n < 3:
		print(-1)
		continue
	if k > int((n - 1) / 2):
		print(-1)
		continue
	flag = False
	for j in range(k):
		arr[2 * j + 1] = n - j
	j = 1
	for x in range(n):
		if arr[x] == 0:
			arr[x] = j
			j += 1
	for x in range(n):
		print(arr[x], end=' ')
	print()