#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 Genshin Impact\textit{Genshin Impact}, 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 (0,0)(0,0) facing (x0,y0)(x_0, y_0) initially, making a charged attack which lasts for tt units of time, and rotates 11 rad counter-clockwise per unit of time. That is to say, Neuvillette turns a circle counter-clockwise in 2π2 \pi units of time.

Consider a ray from (0,0)(0,0) towards the direction Neuvillette faces. The attack range is the set of points whose distance to the ray is at most dd. If the target, whose shape is a convex polygon, has common points with the attack range, it will suffer 11 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 tt units of time.

输入格式

There is only one test case in each test file.

The first line contains five integers nn, x0x_0, y0y_0, dd, and tt (3n1003 \le n \le 100, 104x0,y0104-10^4 \le x_0, y_0 \le 10^4, x02+y02>0x_0^2 + y_0^2 > 0, 1d,t1041 \le d, t \le 10^4).

For the following nn lines, the ii-th line contains two integers xix_i and yiy_i (104xi,yi104-10^4 \le x_i, y_i \le 10^4), indicating the coordinates of the ii-th vertex of the convex polygon.

All nn 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 (0,0)(0,0) with radius dd. 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 tt units of time.

Your answer will be considered correct if its absolute or relative error does not exceed 10610^{-6}. Formally speaking, suppose that your output is aa and the jury's answer is bb, your output is accepted if and only if abmax(1,b)106\frac{|a - b|}{\max(1, |b|)} \le 10^{-6}.

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} :::