The first line of the input is T, the number of test cases.
Each case has thee lines.
First line has two integers – m n, 1 < m, n < 100. the number of break point of the left wall and the right wall.
Second line has 2m integers, p
0x p
0y p
1x p
1y……p
m-1x p
m-1y, describing the coordinate of the break points in the left wall, from the bottom to top.
Third line has 2n integers, q
0x q
0y q
1x q
1y……q
n-1x q
n-1y, describing the coordinate of the break points in the right wall, from the bottom to top.
You can assume:
- p0y < p1y <……< pm-1y,q0y < q1y <……< qm-1y,p0y = q0y, p0x < q0x
- The two walls do not touch or intersect.
- The two walls have zero thickness.
- All the numbers in the input are in the range [0, 1000].