/* ta yag odo batorshihiin code harj bn */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef long long ll; const ll MOD = 1e9 + 7; const ll INFl = 9223372036854775807ll; const int inf = (1 << 28) - 1; #define ff first #define ss second #define pb push_back #define _N 100005 #define mk make_pair ll power(ll x, ll y, ll z) { ll t = 1; while (y > 0) { if (y % 2) { t = (t * x) % z; } x = (x * x) % z; y /= 2; } return t; } int movex[4] = {0, 1, -1, 0}; int movey[4] = {1, 0, 0, -1}; int movexx[8] = {-1, 0, 1, 1, 1, 0, -1, -1}; int moveyy[8] = {1, 1, 1, 0, -1, -1, -1, 0}; ll sqr (ll x) { return x * x; } int n, a[_N]; bool fa (long long len, long long c) { if (len <= 0) return 0; if (len * (len + 1) / 2 >= c) return 1; return 0; } int main () { long long len1, c, len; int sz, Q; scanf ("%d", &Q); while (Q --) { scanf ("%lld%lld", &len, &c); len1 = len; sz = 0; bool ok = 0; if (len * (len - 1) / 2 >= c) { if (c == 0) { for (int i = 1;i <= len; i ++) printf ("%d ", i); printf ("\n"); continue; } len --; for (;;) { if (len < 0 || c < 0) { break; } if (c == len) { a[sz ++] = len + 1; for (int i = 1;i <= c; i ++) a[sz ++] = i; ok = 1;break; } c -= len; if (fa (len - 2, c)) { a[sz ++] = len; a[sz ++] = len + 1; len -= 2; } else a[sz ++] = len + 1, len --; } if (!ok)printf ("-1\n"); else { for (int i = 0;i < sz; i ++) printf ("%d ", a[i]); printf ("\n"); } } else printf ("-1\n"); } return 0; }