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

建议使用的浏览器:

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

4736:This Is The Job The Bear Finds

题目描述
This is the job the bear finds
This is the job the bear finds
This is the job the bear finds
Not with a code but a brick.


                                                  - Kenneth Snow, The Hollow Bear

Bearchild is working in a construction team. Life is hard, and his job is just carrying bricks from here to there, what a waste of time! So, our lovely Bearchild has invented a strange machine to help him.
The machine consists three parts: A rope, a little, round pulley (regarded as points) and a big pulley which is a convex hull (Bearchild is short of money and can't make his big pulley round!).
One end of the rope is fixed with bricks, the rope goes around the small pulley, and finally connects the big pulley on its contour. It's guaranteed that the small pulley is located to the left of the big one.
You can see that when the big pulley spins clockwise around its center of gravity, the bricks will be pulled up, and finally reach the small pulley as the destination. Note that the rope will circle around the contour of the big pulley as it spins.
See the picture for more information, there will be no collision when spinning.


In this problem, first of all we let the pulley spin for one or more circles so the rope becomes tight.
After that, the positions of the two pulleys are given. Then you have to deal a lot of queries, for each query, the distance from the bricks and the small pulley (also as the destination) is given.
Your task is to calculate the degree the pulley has yet to spin to pull the bricks to the destination.
输入解释
The first line has a number T (T <= 1000) , indicating the number of test cases.
For each test case, first line is a number n, which is the number of points of the big pulley (As a convex hull). Then n lines follow, each with two numbers as the x and y coordinate of each point.
Those points are given in counter-clockwise order. Then a line with two numbers, which are the x and y coordinate of the small pulley. Those coordinates are in the range [-1000000, 1000000].
Then a number m indicating the number of queries.
For next q lines, each contains a number l (0 < l < 109), which is the distance between the bricks and the small pulley.
For 90% of the data, we have n,m <= 100, All the data have n <= 104, m <= 105, and all the numbers in the input are integers.
输出解释
For every case, you should output "Case #t:" at first, without quotes. The t is the case number starting from 1.
Then q lines each answers a query in the Input, which should be printed accurately rounded to three decimals.
输入样例
2
4
0 0
1 0
1 1
0 1
-1 2
2
1
4
3
0 0
1 1
-1 1
-2 1
3
1
2
3
输出样例
Case #1:
90.000
360.000
Case #2:
64.413
140.446
233.660
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-4736

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

共提交 0

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