-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1535A.cpp
More file actions
32 lines (25 loc) · 749 Bytes
/
1535A.cpp
File metadata and controls
32 lines (25 loc) · 749 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
#include<iostream>
using namespace std;
int find_max_index(int arr[4]){
int max_index = -1;
int max_value = 0;
for(int i=0; i<4; i++){
if(arr[i] > max_value){
max_value = arr[i];
max_index = i;
}
} return max_index;
}
int main(){
int t, arr[4], first_max_index, second_max_index;
cin >> t;
for(int i=0; i<t; i++){
cin >> arr[0] >> arr[1] >> arr[2] >> arr[3];
first_max_index = find_max_index(arr);
arr[first_max_index] = -1;
second_max_index = find_max_index(arr);
if( first_max_index + second_max_index == 1 || first_max_index + second_max_index == 5 ) cout << "NO" << endl;
else cout << "YES" << endl;
}
return 0;
}