import java.util.*; import java.io.*; class Main{ private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static final PrintWriter out = new PrintWriter(System.out); public static void main(String[] args)throws IOException{ int T = Integer.parseInt(br.readLine()); while(T-->0){ String[] str = br.readLine().split(" "); int N = Integer.parseInt(str[0]); long X = Long.parseLong(str[1]); if(X<(long)N*(N+1)/2) out.println(-1); else{ for(int i=1;i