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 int m=(len*(len-1))/2; if(m=1;i--) a[n-i]=i; return a; } c-=(n-1); if(n>1) { a[0]=n-1; int b[]=comp(n-1,c,0); for(int i=1;i