forked from kothariji/competitive-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path(CODECHEF)_A_Rationalee.cpp
57 lines (52 loc) · 953 Bytes
/
(CODECHEF)_A_Rationalee.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Author-Yogesh kansal
*/
#include <bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;
#define M 1000000007LL
#define mod 998244253LL
#define ll long long int
#define vi vector<int>
#define vii vector<vector<int>>
#define pii pair<int, int>
#define vpii vector<pair<int,int>>
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define mp make_pair
#define all(p) p.begin(),p.end()
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int main() {
//clock_t t=clock();
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
ll a,b,n,m;
cin>>a>>b>>n>>m;
if(a+b<n+m) cout<<"NO\n";
else if(a>b)
{
if(b>=m)
cout<<"YES\n";
else if(a-n>=m&&(a-n)<=b) cout<<"YES\n";
else
cout<<"NO\n";
}
else{
if(a>=m)
cout<<"YES\n";
else if((b-n)>=m&&(b-n)<=a) cout<<"YES\n";
else
cout<<"NO\n";
}
}
return 0;
}