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(); while(q-->0) { int n=in.nextInt(); int c=in.nextInt(); int a[]=new int[n]; for(int i=0;i(n*(n-1))/2) System.out.println("-1"); else { int i=0; while(c>0) { int temp=a[i+1]; a[i+1]=a[i]; a[i]=temp; i++; i=i%n; c-=2; } for(int j=0;j