Skip to content

Instantly share code, notes, and snippets.

@diego9627
Created April 28, 2013 00:02
Show Gist options
  • Save diego9627/5475248 to your computer and use it in GitHub Desktop.
Save diego9627/5475248 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
bool test(int N,int K){
int T;
if(!(N%2)){
T= (N)*(N)/2+1;
}
else{
T= (N+1)*(N)/2;
}
return (K<=T);
}
int main(){
int T,N,K;
cin >> T;
for(int i=0;i<T;i++){
cin >> N >> K;
if(test(N+1,K)) cout << "Yes\n";
else cout << "No\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment