当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3822:Moving the Mouse

题目描述
You know when playing computer games, the mouse is very important. Someone is such a slovenly boy. His desk on which he puts many things is really a mess. For playing games well, he should be able to use the mouse to reach everywhere on screen. His screen’s shape is very strange. It’s a convex polygon so that in order to reach everywhere on screen, he should be able to move his mouse at least everywhere within a convex polygon on the desk. He is too lazy to clean his desk, so he wonders if there is enough space to use his mouse. Can you help him find out if there is enough space? Put it another way, you should find out whether it is possible to put the convex polygon the mouse needs at least on the desk without any intersections with any other things.

You may assume the mouse is just a point and cannot rotate. You may also assume all the things on his desk are convex polygons. Note that these polygons may intersect each other; the mouse can be everywhere on the desk but not be strictly inside any convex polygon of something. You will be given the convex polygons of all the things on his desk and the convex polygon the mouse needs at least.
输入解释
The first line contains a single integer T, indicating the number of test cases.
Each test case begins with three integers X, Y, and N. The desk’s lower left coordinates are always (0, 0) and its upper right coordinates are (X, Y). N indicates the number of things on his desk.
Then one line follows. This line contains an integer M followed by M pairs of integers. Each of the pair indicates a vertex of the convex polygon the mouse needs at least. The vertices will be given counterclockwise.
Then N lines follow, each line contains an integer L followed by L pairs of integers. Each of the pair indicates a vertex of the thing’s convex polygon. The vertices will be given counterclockwise.

Technical Specification

1. 1 <= T <= 1000
2. 0 <= N <= 20
3. 3 <= M <= 20
4. 3 <= L <= 20 and all the things are inside the desk.
5. All the coordinates will be greater than or equal to 0 and less than or equal to 10000.
输出解释
For each test case, output the case number first, then the words “Yeah, there is enough space!” if there is enough space on the desk to use the mouse or “Oh, I have to clean my desk!”, otherwise.
输入样例
3
10 10 1
4 0 0 2 0 2 2 0 2
4 1 1 9 1 9 9 1 9
10 10 1
3 0 0 2 0 0 2
4 1 1 9 1 9 9 1 9
9 9 4
4 0 0 1 0 1 1 0 1
4 0 0 5 0 5 4 0 4
4 9 0 9 5 5 5 5 0
4 9 9 4 9 4 5 9 5
4 0 9 0 4 4 4 4 9
输出样例
Case 1: Oh, I have to clean my desk!
Case 2: Yeah, there is enough space!
Case 3: Yeah, there is enough space!

提示
or the third sample, he can put the mouse in the middle of the desk to reach everywhere within the unit square. See figure below.
来自杭电HDUOJ的附加信息
Author Dumbear@WHU
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3822

最后修改于 2020-10-25T23:07:17+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/8000MS(Java/Others) 32768/32768K(Java/Others)