-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathICPC_N.cpp
More file actions
42 lines (41 loc) · 787 Bytes
/
ICPC_N.cpp
File metadata and controls
42 lines (41 loc) · 787 Bytes
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 t;
cin >> t;
while(t--)
{
long long c[3],a[5];
long long x,y,z,m,n,i;
for(i=0;i<3;i++){
cin >> c[i];
}
for(i=0;i<5;i++){
cin >> a[i];
}
x=c[0]-a[0];
y=c[1]-a[1];
z=c[2]-a[2];
if(x<0||y<0||z<0){
cout <<"NO\n";
}
if(x>=0&&y>=0&&z>=0){
a[3]-=x;
a[4]-=y;
if(a[3]<=0){
a[3]=0;
}
if(a[4]<=0){
a[4]=0;
}
if(z-a[3]-a[4]>=0){
cout << "YES\n";
}
else{
cout << "NO\n";
}
}
}
return 0;
}