#include<bits/stdc++.h> usingnamespacestd; constint N = 1e5+10;
typedeflonglong ll; intmain(){ int T; scanf("%d", &T); while (T--) { ll k; int n; scanf("%d%lld", &n, &k); if (n == 1) { if (k == 0) { printf("1\n"); } else { printf("-1\n"); } continue; } ll x = 0; for (int i = 2; i <= n; i++) x += i; if (k < x) { printf("-1\n"); continue; } int l = 1, r = n; vector<int> vec; while (l + 1 < r) { if (x + r - l - 1 <= k) { x += r - l - 1; vec.push_back(l++); vec.push_back(r--); } else { vec.push_back(l++); } }
for (int i = l; i <= r; i++) vec.push_back(i); if (x != k || vec.size() != n) { printf("-1\n"); continue; } for (int i = 0; i < n; i++) { printf("%d%c", vec[i], " \n"[i==n-1]); } } }