2015
09-18

Exhausted Robot

You want a tidy palace but you are too lazy to do the cleaning. As a result, your cousin Coach Pang gave you a cleaning robot. Unfortunately, the robot has some flaws and some furniture may hamper the cleaning.
To simplify the problem, we consider all objects in a 2D-Plane. The room is viewed as a rectangle with edges parallel to the axis. Both robot and furniture are in shape of convex polygons.
During the cleaning, the robot can move towards any direction (but only translation are permitted which means it cannot rotate). Although the robot has the ability to move through furniture, it can only do cleaning when it has no area outside the room or intersect with furniture. Besides, only one point can do the cleaning which is given as the first vertex of the robot in the input.

The first line of the input contains an integer T indicates the number of test cases.
In the first line of each test case, there will be an integer n (0 <= n <= 20) and then (n + 1) blocks of data describing the objects. The first n blocks for furniture and the last one for the robot. All the vertices of an object are shown in corresponding block with counter-clockwise order. The first line of each block contains an integer m (3 <= m <= 20). Then m lines follow. In each line, there are two integers xi, yi indicating a vertex of the convex polygon.
��At the end of each set of data, there will be four integers in a line, xBL, yBL, xTR, yTR, indicates the coordinates of the bottom left corner and the top right corner of your room.
��The absolute value of all coordinates are within 103.

The first line of the input contains an integer T indicates the number of test cases.
In the first line of each test case, there will be an integer n (0 <= n <= 20) and then (n + 1) blocks of data describing the objects. The first n blocks for furniture and the last one for the robot. All the vertices of an object are shown in corresponding block with counter-clockwise order. The first line of each block contains an integer m (3 <= m <= 20). Then m lines follow. In each line, there are two integers xi, yi indicating a vertex of the convex polygon.
��At the end of each set of data, there will be four integers in a line, xBL, yBL, xTR, yTR, indicates the coordinates of the bottom left corner and the top right corner of your room.
��The absolute value of all coordinates are within 103.

2
1
4
3 3
4 3
4 4
3 4
4
1 1
2 1
2 2
1 2
0 0 10 10
0
4
1 1
2 1
2 2
1 2
0 0 10 10

Case #1: 77.000
Case #2: 81.000

1. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

2. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

3. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

4. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

5. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

6. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

7. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

8. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

9. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

10. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。

11. 来，请你打开随便一个视频网站，点开北京奥运会开幕式，看前10分钟报名字的那些，现在还剩几个？政治啊，就是一堆老狐狸勾心斗角的，不是几个傻白甜在哪里瞎搞的。