import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int TARGET = 0; public static void main(String[] args) { Scanner in = new Scanner(System.in); int q = in.nextInt(); for(int a0 = 0; a0 < q; a0++){ int len = in.nextInt(); int c = in.nextInt(); List input = new ArrayList<>(len); for(int i=1; i<=len;i++){ input.add(i); } // your code goes here TARGET=c; //System.out.println("RESULT->"); List res = lena_sort(input,c); if(TARGET<=0){ printArray(res); }else{ System.out.println(-1); } //System.out.println("<-RESULT<"+TARGET); } } public static void printArray(List a){ for(int v: a){ System.out.printf("%d ",v); } System.out.println(); } public static List lena_sort(List nums, int target) { if (nums.size() <= 1||target<1) { return nums; } int pivot = nums.get(0); List less = new ArrayList<>(); List more = new ArrayList<>(); for (int i = 1; i < nums.size(); i++,target--,TARGET--) { // Comparison if (nums.get(i) sorted_more = lena_sort(more,target); List sorted_less = lena_sort(less,target); List ans = new ArrayList<>(); ans.addAll(sorted_more); ans.add(pivot); ans.addAll(sorted_less); return ans; } }