-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplst.cpp
More file actions
35 lines (34 loc) · 806 Bytes
/
splst.cpp
File metadata and controls
35 lines (34 loc) · 806 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
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pr pair<int,int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--) {
long a,b,c,x,y;
cin>>a>>b>>c>>x>>y;
if(a+b+c<x+y) {
cout<<"NO\n";
continue;
}
long s=x+y;
if((((a<x&&b<=y)||(a<=x&&b<y))&&(c==s-(a+b)))||
(((b<x&&c<=y)||(b<=x&&c<y))&&(a==s-(b+c)))||
(((c<x&&a<=y)||(c<=x&&a<y))&&(b==s-(a+c)))||
(((b<x&&a<=y)||(b<=x&&a<y))&&(c==s-(b+a)))||
(((c<x&&b<=y)||(c<=x&&b<y))&&(a==s-(b+c)))||
(((a<x&&c<=y)||(a<=x&&c<y))&&(b==s-(a+c))))
cout<<"YES\n";
else
cout<<"NO\n";
}
return 0;
}