#include using namespace std; using ll=long long; int main(){ ll t; cin>>t; while(t--){ ll n,x; cin>>n>>x; ll sum=0; vector ans; for(ll i=1;i<=n-1;i++){ ans.push_back(i); sum+=i; } if(x-sum