time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
G.
2
2
1 1
2
1 1

2
1 2
2
3 3
Output
Yes
1 0
1 1
0 1
0 0
No
Input
2
4
1 1 1 1
4
1 1 1 1

3
2 1 1
3
2 1 1
Output
Yes
1 0
1 1
2 1
2 2
1 2
1 1
0 1
0 0
Yes
0 -2
2 -2
2 -1
1 -1
1 0
0 0
Input
2
4
1 4 1 2
4
3 4 5 12

4
1 2 3 6
2
1 3
Output
Yes
2 0
2 3
3 3
3 7
4 7
4 12
0 12
0 0
No