import java.util.ArrayList; import java.util.List; import java.util.Scanner; 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 int perm = getperm(len); if (len == 1) { System.out.println(1); }else if (c == perm) { String s=""; for(int i=len; i>0; i--){ s = s+ i +" "; } System.out.println(s); } else if (c > perm || c < len - 1) { System.out.println(-1); } else { findSol(len, c); } } } private static void findSol(int len, int c) { String sol = ""; List alreadyIn = new ArrayList<>(); int count = 0; for (int i = len-1; i > 0; i--) { if (count + i <= c) { count = count + i; alreadyIn.add(i); } if (count == c) { break; } } for (Integer i : alreadyIn) { sol = sol + i + " "; } for (int i = 1; i <= len; i++) { if (!alreadyIn.contains(i)) { sol = sol + i + " "; } } System.out.println(sol); } private static int getperm(int q) { int prem = 0; for (int i = 1; i < q ; i++) { prem = prem + i; } return prem; } }