-
Notifications
You must be signed in to change notification settings - Fork 0
/
1535Aa.cpp
36 lines (35 loc) · 881 Bytes
/
1535Aa.cpp
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
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, s1, s2, s3, s4;
cin >> n;
for(int i=0; i<n; i++){
cin >> s1 >> s2 >> s3 >> s4;
int arr[4] = {s1, s2, s3, s4};
int max = s1;
int max2;
for(int j =0; j<4; j++){
if(arr[j] > max){max = arr[j];}}
int min = max;
for(int j =0; j<4; j++){
int d = (max - arr[j]);
if(d < min && d != 0){
min = d;
max2 = arr[j];
}
}
int w1 = (s1 > s2) ? s1 : s2;
int w2 = (s3 > s4) ? s3 : s4;
if(w1 == max || w1 == max2){
if (w2 == max || w2 == max2){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
else{
cout << "NO" << endl;
}
}
}