#!/bin/python3 import sys import random count = 0 def pivotless(A,pivot,count): x = 9223372036854775807 lessum = list() if len(A) > 1: for i in range(0,len(A)): if A[i] < pivot: lessum.append(A[i]) count = count+1 return lessum,count def pivotmore(B,pivot,count): x = 0 moreum = list() if len(B) > 1: for i in range(0,len(B)): if B[i] > pivot: moreum.append(B[i]) count = count+1 return moreum,count def lena_sort(nums,count): if len(nums)<=1: return nums,count pivot = nums[0] less,count = pivotless(nums,pivot,count) more,count = pivotmore(nums,pivot,count) # less = list() # more = list() # for _ in range(0,len(nums)): # if (nums[_] < pivot): # less.append(nums[_]) # count = count+1 # else: # more.append(nums[_]) # count = count+1 sorted_less,count = lena_sort(less,count) sorted_more,count = lena_sort(more,count) ans = sorted_less ans.append(pivot) ans = ans+sorted_more # + pivot + sorted_more # print(count) return ans,count q = int(input().strip()) for a0 in range(q): lens,c = input().strip().split(' ') lens,c = [int(lens),int(c)] # count = 0 # temp = random.sample(range(c+1), c+1) # temp.remove(0) # print(lena_sort(temp,count)) temp2 = [4,2,1,3,5] # print(lena_sort(temp2,count)) a = lena_sort(temp2,count) # # print(pivotmore(temp2,4)) done = 0 for als in range(0,lens): count = 0 temp = random.sample(range(lens+1), lens+1) temp.remove(0) # print(temp) a,a2 = lena_sort(temp,count) # print(a2) if a2 is c: # print(temp) for item in temp: print(item,end=" ") done = 1 print("") break if done is 0: print(-1) print("")