编程介的小学生 2019-11-30 22:48 采纳率: 20.5%
浏览 88

The gold miners 程序的编写

Problem Description
There are some funny mini games on the internet. Sailormoon girls usually play these games in them spare time. They always play a mini game named THE GOLD MINNERS. Now they give you a problem about this game. Could you solve it? Now let’s look at the following picture.

We set the position of the minner as the origin of coordinate.There are many objects in this game,not only gold. They also have diamonds,stones,and other unknown things.All the objects can be treated as polygon. Every two polygons can not intersect. In this problem,we will give you some data about the angle in order. When the hook with certain angle sinking, it will always catch nearest object, and get the corresponding money. There will be nothing in the position of this object later. If there have no objects,the hook will return back to the origin of coordinate. How much money does the minner have at last?Do you know?

Input
There are multiple test cases.
Each case begins with a positive integer N (0 <= N <= 30) , it means there are N objects.
The following N * 2 lines describe the informatin about objects. Each object starts with a positive integer V (3 <= V <= 15), it means this object can be treated as a polygon with V vertex. Followed by a positive integer W which is the value of this object.
The next line contains V * 2 decimal number. X1,Y1,X2,Y2……Xv,Yv. You can suppose all coordinate data are in the double range.Vertex coordinates clockwise.
Then followed by a positive integer M (M <= 100) which is number of the minner cast hook.
The following M lines contains M positive integer.The Xth integer means the angle with which the minner cast hook the Xth.(0 < angle < 180)

Output
Calculate and print the value of the minner earn at last for each test case.

Sample Input
4
4 158
0.0 -1.0 2.0 -1.0 0.0 -3.0 -1.0 -2.0
4 37
4.0 -1.0 4.0 -2.0 3.0 -2.0 3.0 -1.0
6 360
2.0 -3.0 3.0 -3.0 2.0 -5.0 1.0 -5.0 1.0 -4.0 2.0 -4.0
5 223
-2.0 -4.0 -2.0 -5.0 -3.0 -6.0 -4.0 -5.0 -4.0 -4.0
3
45
16
127

5
4 10
-3.0 0.0 -2.0 -1.0 -3.0 -1.0 -4.0 0.0
4 208
-2.0 0.0 0.0 -1.0 3.0 -1.0 0.0 -3.0
6 660
3.0 -2.0 4.0 -2.0 5.0 -3.0 6.0 -3.0 6.0 -6.0 3.0 -6.0
4 25
-1.0 -4.0 2.0 -4.0 2.0 -6.0 -1.0 -6.0
3 18
0.0 -7.0 1.0 -8.0 -1.0 -8.0
3
34
64
90

Sample Output
418
251

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog