#include using namespace std; int main(){ int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ int len; int c; cin >> len >> c; // your code goes here if(c > (len - 1) * len/2.0){ cout << "-1"; } } return 0; }