import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { 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(); // your code goes here if(len == 0 || c < 0) { System.out.println(-1); continue; } if(len == 1) { System.out.println(1); continue; } if(len > 1 && (len)*(len-1)/2 < c) { System.out.println(-1); continue; } int max = (len)*(len-1)/2; List res = new ArrayList<>(); boolean found = false; for (int i = 1; i <= len; i++) { List a = new ArrayList<>(len); for (int j = 0; j < len; j++) { a.add((i+j)%len + 1); } count=0; lena_sort(a); if(count == c) { res = a; found = true; break; } } if(found) { for (int i = 0; i < res.size(); i++) { System.out.print(res.get(i) + " "); } System.out.println(); } else { System.out.println(-1); } } } public static int count = 0; public static List lena_sort(List nums) { if (nums.size() <= 1) { return nums; } int pivot = nums.get(0); List less = new ArrayList<>(); List more = new ArrayList<>(); for (int i = 1; i < nums.size(); ++i) { // Comparison count++; if (nums.get(i) < pivot) { less.add(nums.get(i)); } else { more.add(nums.get(i)); } } List sorted_less = lena_sort(less); List sorted_more = lena_sort(more); sorted_less.add(pivot); sorted_less.addAll(sorted_more); return sorted_less; } }