-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathE.py
More file actions
24 lines (24 loc) · 646 Bytes
/
E.py
File metadata and controls
24 lines (24 loc) · 646 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
for _ in range(int(input())):
c,b,a = input().split()
if a[0] == b[0]:
if a[0] == c[0]:
if a[1] < c[1] and c[1] < b[1]:
print("NO")
elif a[1] > c[1] and c[1] > b[1]:
print("NO")
else:
print("YES")
else:
print("YES")
elif a[1] == b[1]:
if a[1] == c[1]:
if a[0] < c[0] and c[0] < b[0]:
print("NO")
elif a[0] > c[0] and c[0] > b[0]:
print("NO")
else:
print("YES")
else:
print("YES")
else:
print("NO")