-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1535A.c
More file actions
40 lines (39 loc) · 865 Bytes
/
1535A.c
File metadata and controls
40 lines (39 loc) · 865 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
#include <stdio.h>
int main()
{
int n,max,i,a[4],max2;
scanf("%d",&n);
while (n--)
{
for (i=0; i<4; i++)
{
scanf("%d",&a[i]);
}
max = max2 = a[0];
for (i=0; i<4; i++)
{
if (a[i]>max)
{
max2 = max ;
max = a[i];
}
else if (a[i] > max2 && a[i]<max)
{
max2 = a[i];
}
else if (max == max2)
{
max2 = a[i];
}
}
if ( ((max==a[0] || max==a[1]) && (max2==a[2] || max2==a[3])) || ((max==a[2] || max==a[3]) && (max2==a[0] || max2==a[1])) )
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}