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(" "); long N = Long.parseLong(str[0]); long X = Long.parseLong(str[1]); if(X