#!/bin/python import sys from itertools import permutations comp_count = 0 #def prnt(p): # for i in p: # print(i,end=" ") def lena_sort(nums): global comp_count if len(nums) == 1: return nums elif len(nums) == 0: return [] pivot = nums[0] less = [] more = [] for i in range(1,len(nums)): # Comparison if nums[i] < pivot: less.append(nums[i]) comp_count += 1 else: more.append(nums[i]) comp_count += 1 sorted_less = lena_sort(less) sorted_more = lena_sort(more) ans = sorted_less + [pivot] + sorted_more return ans q = int(raw_input().strip()) for a0 in xrange(q): global comp_count length,c = raw_input().strip().split(' ') length,c = [int(length),int(c)] # your code goes here found_it = False if length == 1: if c > 0: print -1 elif c == 0: print 1 else: print -1 continue for p in [list(p) for p in permutations(range(1, length+1))]: comp_count = 0 sp = lena_sort(p) if comp_count == c: print ' '.join([str(t) for t in p]) found_it = True break #print comp_count, sp if not found_it: print -1