#include using namespace std; using ll = long long; #define rep(i,a) for(int i = 0; i < (a); ++i) template bool chmax(T &a,T b){if(a bool chmin(T &a,T b){if(a>b){a=b; return true;} return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; for(;t--;){ ll n,x; cin >> n >> x; ll sum = (1+n)*n/2; if(sum>x) cout << -1 << endl; else { for(int i=0;i