blob: 2f5fb6bdedbe78e0729b5b25041708f31bc277eb (
plain)
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
|
#include<bits/stdc++.h>
using namespace std;
int main() {
int tt,a,b,c,x,y,remX,remY;
cin >> tt;
while (tt--) {
cin >> a >> b >> c >> x >> y;
if(a > x && b < y) {
remX = 0;
remY = y - b;
}
else if (a < x && b > y) {
remX = x - a;
remY = 0;
}
else if (a > x && b > y) {
remX =0;
remY =0;
}
else {
remX = x - a;
remY = y - b;
}
if(c == 0) {
if(a >= x && b >= y) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
else if(c >= remX + remY) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
}
|