-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAIRLINE.cpp
More file actions
44 lines (39 loc) · 744 Bytes
/
AIRLINE.cpp
File metadata and controls
44 lines (39 loc) · 744 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
43
44
//
// Created by abel_ on 06-09-2021.
//
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--)
{
int a,b,c,d,e,c1,c2,c3,sucess;
cin >> a >> b >> c >> d >> e;
c1=a+b;
c2=b+c;
c3=a+c;
sucess=0;
if(c1<=d) {
if ((a + b + c - c1) <= e) {
sucess = 1;
}
}
if(c2<=d){
if((a+b+c-c2)<=e) {
sucess=1;
}
}
if(c3<=d){
if((a+b+c-c3)<=e) {
sucess=1;
}
}
if(sucess){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}
return 0;
}