#P14026. [ICPC 2024 Nanjing R] Ordainer of Inexorable Judgment
[ICPC 2024 Nanjing R] Ordainer of Inexorable Judgment
题目描述
Neuvillette is the Chief Justice of Fontaine, known as the Iudex, and he is renowned for his unassailable impartiality. As a playable character in the world-famous game , he is known for his powerful charged attack that can hit enemies within a specific range.
Since he is very powerful, many players use him while challenging almost every quest. However, not everybody in Teyvat is happy about this, especially other ADC (Attack Damage Carry) characters, including Kamisato Ayaka, Keqing, etc. Together, they decide to persuade Mihoyo to nerf Neuvillette in the game. To do so, they must submit a report about Neuvillette's total damage in several scenarios.
:::align{center}
Created from Genshin Impact official material :::
Each battle scenario happens on a two-dimensional plane. Neuvillette stands on facing initially, making a charged attack which lasts for units of time, and rotates rad counter-clockwise per unit of time. That is to say, Neuvillette turns a circle counter-clockwise in units of time.
Consider a ray from towards the direction Neuvillette faces. The attack range is the set of points whose distance to the ray is at most . If the target, whose shape is a convex polygon, has common points with the attack range, it will suffer continued damage per unit of time.
As an experienced programmer, you are summoned by Ayaka. This time, your task is to calculate the damage the target incurs in the first units of time.
输入格式
There is only one test case in each test file.
The first line contains five integers , , , , and (, , , ).
For the following lines, the -th line contains two integers and (), indicating the coordinates of the -th vertex of the convex polygon.
All vertices are given in counter-clockwise order, and any three of them are not collinear. It is also guaranteed that the shape has no common points with the circle centered at with radius . That is to say, there does not exist a point inside or on the boundary of the convex polygon, while at the same time inside or on the boundary of the circle.
输出格式
Output one line containing one real number, indicating the damage the target incurs in the first units of time.
Your answer will be considered correct if its absolute or relative error does not exceed . Formally speaking, suppose that your output is and the jury's answer is , your output is accepted if and only if .
3 1 0 1 1
1 2
2 1
2 2
1.000000000000
3 1 0 1 2
1 2
2 1
2 2
1.570796326795
3 1 0 1 10000
1 2
2 1
2 2
2500.707752257475
提示
The figure below simultaneously shows the initial state of the sample test cases.
:::align{center}
:::