Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
- #define debug(x) cout << #x << "--> " << x << endl;
- #define int long long
- #define pii pair<int, int>
- using namespace std;
- main()
- {
- fastio;
- int tc;
- cin >> tc;
- while(tc--)
- {
- int n, m, a, b;
- cin >> a >> b >> n >> m;
- if(a + b < n + m)
- cout << "NO" << endl;
- else
- {
- if(min(a, b) >= min(n , m))
- {
- int Min;
- if(n < m) Min = n;
- else Min = m;
- a -= Min;
- b -= Min;
- if(Min == n)
- {
- m -= Min;
- if(min(a, b) >= m) cout << "YES" << endl;
- else cout << "NO" << endl;
- }
- else
- {
- n -= Min;
- if(a + b >= n) cout << "YES" << endl;
- else cout << "NO" << endl;
- }
- }
- else cout << "NO" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement