#include<bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define fr first
#define sc second
#define endl '\n'
using namespace std;
#define mid ((left+right)>>1)
int main(){
ios_base::sync_with_stdio(23^23);cin.tie(NULL);
int q,s;
cin>>s>>q;
while(q--){
ll c1,f1,c2,f2;cin>>c1>>f1>>c2>>f2;
if(c1<=f2&&c2<=f1){
if(f2-c1<=f1-c2)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
else if(c1>f2&&c2>f1){
int sira=0;
while(min(c1-f2,c2-f1)>0){
if(sira){
c1-=c2-f1;
}
else c2-=c1-f2;
sira^=1;
}
if(c1-f2>0){
cout<<"YES"<<endl;
}
else cout<<"NO"<<endl;
}
else if(c1>f2){
cout<<"YES"<<endl;
}
else cout<<"NO"<<endl;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |