import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int count=0; static void quickSort(int[] ar) { count=0; partition(ar, 0, ar.length); } static void partition(int[] ar, int l, int r) { if ((r - l) < 2) { return; } else { int pivotIndex = l; int indexForArrayList = 0; int pivot = ar[l]; ArrayList leftArrayList = new ArrayList(); leftArrayList.add(pivot); for (int i = l + 1; i < r; i++) { int cur = ar[i]; if (cur < pivot) { leftArrayList.add(indexForArrayList, cur); indexForArrayList++; pivotIndex++; count++; } else { leftArrayList.add(cur); } } for (int i = l; i < r; i++) { ar[i] = leftArrayList.get(i - l); } partition(ar, l, pivotIndex); partition(ar, pivotIndex + 1, r); printArray(Arrays.copyOfRange(ar, l, r)); } } static void printArray(int[] ar) { for (int n : ar) { System.out.print(n + " "); } System.out.println(""); } /*public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] ar = new int[n]; for (int i = 0; i < n; i++) { ar[i] = in.nextInt(); } quickSort(ar); }*/ public static void comp(int arr[]){ for(int i=0;i=0;i--){ System.out.print(arr[i]+" "); } System.out.println(); } 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(); int temp=(len*len)/2-len/2; int arr[]=new int[len]; for(int i=0;ilen-1){ }else{ Collections.shuffle(arr); quickSort(arr); if(count==c){ printArray(arr); } System.out.println(-1); } // your code goes here } } }