/* -*- coding: utf-8 -*- * * 2567.cc: No.2567 A_1 > A_2 > ... > A_N - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ ll sigma(int n) { return (ll)n * (n + 1) / 2; } /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { int n; ll x; scanf("%d%lld", &n, &x); if (sigma(n) > x) { puts("-1"); continue; } int b0 = n - 1, b1 = 2000000000; while (b0 + 1 < b1) { int b = ((ll)b0 + b1) / 2; if (sigma(b) - sigma(b - n) >= x) b1 = b; else b0 = b; } //printf("b1=%d\n", b1); for (int i = 0, ai = b1; i < n; i++) { while (sigma(ai - 1) - sigma(ai - 1 - (n - i)) >= x) ai--; x -= ai; printf("%d%c", ai, (i + 1 < n) ? ' ' : '\n'); } } return 0; }