G. Map Matching
time limit per test
1 s
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
4
0 0
2 2
10 2
8 0
5 -5
1 -5
2 -4
6 -4
3
1 0
0 2
1 2
0 0
2 1
2 0
Output
YES
NO