import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static long counter = 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(); long max = getMaxCmpCount(len); long min = getMinCmpCount(len); //System.out.println("---Min:" + min + " Max:" + max + " Len:" + len); if(c > max || c < min){ System.out.println(-1); }else{ System.out.println(printNumString(len)); } } } private static String printNumString(int len){ if(len == 1){ return getNextNumber(); }else if (len == 2){ return getNextTwoNumber(); }else if (len == 3){ return getNextThreeNumber(); }else{ if(len%2 == 1) return printNumString((len-1)/2) + " " + getNextNumber() + " " + printNumString((len-1)/2); else return printNumString(len/2) + " " + getNextNumber() + " " + printNumString((len-1)/2); } } private static String getNextNumber(){ return ++counter + ""; } private static String getNextTwoNumber(){ return getNextNumber() + " " + getNextNumber(); } private static String getNextThreeNumber(){ String min = getNextNumber(); String mid = getNextNumber(); String max = getNextNumber(); return mid + " " + min + " " + max; } public static long getMinCmpCount(int len){ if(len == 1) return 0; else if(len == 2){ return 1; }else if (len == 3){ return 2; }else{ if((len-1)%2 == 0){ return (len-1) + getMinCmpCount((len-1)/2) + getMinCmpCount((len-1)/2); }else{ return (len-1) + getMinCmpCount((len-1)/2) + getMinCmpCount((len-1)/2 +1); } } } public static long getMaxCmpCount(int len){ long maxSum = 0; while(len-1 > 0){ maxSum += --len; } return maxSum; } }