#P4518. [JSOI2018] 绝地反击

    ID: 3489 远端评测题 1000ms 250MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2018各省省选江苏Special JudgeO2优化

[JSOI2018] 绝地反击

Description

Thanks to your excellent performance, the aliens’ attack has been successfully repelled. Now, JYY has assembled the powerful Golden Fleet, ready to destroy the alien mothership in a single strike.

The Golden Fleet has n(n3)n\,(n\ge 3) ships. These ships can focus their energy at a single point (the mothership’s location) to deliver a devastating blow. JYY plans to warp all ships near the mothership simultaneously and launch an attack instantly to end the battle.

After the warp, due to various instabilities, the ships are not in optimal attack positions and must be adjusted quickly. Now all ships have completed the warp at the same time, and each ship can be viewed as a point on the plane. The ii-th (1in1\le i\le n) ship is at coordinates (xi,yi)(x_i, y_i). The alien mothership is at the origin (0,0)(0, 0).

To achieve the most effective strike, all ships must move onto the attack orbit. The attack orbit is the circle centered at (0,0)(0, 0) with radius RR. Because the energy released is extremely large, JYY wants the distances between ships at the moment of firing to be as large as possible. Specifically, JYY wants all nn ships of the Golden Fleet to be evenly arranged on the attack orbit (all ships are identical, so any order is acceptable), that is, the distances along the arc between adjacent ships on the attack orbit are equal and exactly 2πRn\frac{2\pi R}{n}. In other words, JYY wants to adjust all ships so that they all lie on the attack orbit and are exactly at the nn vertices of a regular nn-gon.

Please help JYY compute the minimum time to start the strike (i.e., the least time for all ships to move onto the attack orbit and be equally spaced). A ship can move one unit of distance per unit of time in the plane, and the volume of a ship can be considered 00. Therefore, in your plan, it is allowed for ships to “meet” at some moment. Initially, ships’ coordinates are also allowed to coincide.

Input Format

The first line contains two integers n,Rn, R, representing the number of ships and the radius of the attack orbit.

The next nn lines each contain two integers (xi,yi)(x_i, y_i), representing the coordinates of each ship.

Output Format

Output one line: the minimum time for all ships to be in position (print with sufficient precision). Your answer is considered correct if the absolute error from the reference answer does not exceed 10610^{-6}.

3 1
0 0
0 0
0 0
1.00000000
3 10
10 0
0 10
10 10
12.17522858

Hint

  • For 20%20\% of the testdata, n=3n = 3.
  • For 50%50\% of the testdata, n50n \le 50.
  • For 100%100\% of the testdata, 3n2003 \le n \le 200, $0 \le \lvert x_i \rvert, \lvert y_i \rvert, R \le 100$.

Translated by ChatGPT 5