Problem A: [NOIP2017day2]奶酪

Time Limit: 1 Sec Memory Limit: 256 MB

Description

image.png

Sample Input

3
2 4 1
0 0 1
0 0 3
2 5 1 
0 0 1 
0 0 4 
2 5 2 
0 0 2 
2 0 4 

Sample Output

Yes
No
Yes

HINT

image.png