using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); for (int a0 = 0; a0 < q; a0++) { string[] tokens_len = Console.ReadLine().Split(' '); int len = Convert.ToInt32(tokens_len[0]); int c = Convert.ToInt32(tokens_len[1]); int[] newArray = { 4, 2, 1, 3, 5 }; for (int i = 0; i < len; i++) { if (((len / 2) - i) >= 1) { newArray[i] = (len / 2) - i; } else { newArray[i] = i; } } List tt = new List(); tt.Add(4); tt.Add(2); tt.Add(1); tt.Add(3); tt.Add(5); newArray = tt.ToArray(); int newC = c; List tempA = newArray.ToList(); tempA= lenaSort(tempA,newC); if (tempA[0] == newC) { foreach (var item in newArray) { Console.Write(item + " "); } } else { Console.WriteLine(-1); } } } private static List lenaSort(List newArray, int newC, int counter = 0) { if (newArray.Count <=1) { return newArray; } int pivot = newArray[0]; List less = new List(); List more = new List(); for (int i = 0; i < newArray.Count; i++) { counter++; if (counter>newC) { break; } if (newArray[i] sortedLess = lenaSort(less,newC,counter); List sortedmore = lenaSort(more, newC,counter); List ans = new List(); ans.Add(counter); return ans; } }