QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB مجموع النقاط: 100

#522. Counterattack

الإحصائيات

Background

Thanks to your outstanding performance, the alien invasion has been successfully thwarted. Now, JYY has assembled the powerful Golden Fleet, ready to destroy the alien mothership in a single strike.

Description

The Golden Fleet consists of $n$ ($n \ge 3$) starships. These ships can focus their energy on a single point (the location of the alien mothership) to deliver a devastating blow. JYY plans to warp all ships to the vicinity of the mothership simultaneously and launch an attack to end the battle instantly.

After the Golden Fleet arrives via warp, due to various unstable factors, the ships in the fleet have not reached their optimal attack positions, so they need to be adjusted quickly. Now, all ships have completed the warp simultaneously. Each ship can be treated as a point on a plane, and the coordinates of the $i$-th ($1 \le i \le n$) ship are $(x_i, y_i)$. The alien mothership is located at the origin $(0,0)$.

To achieve the most efficient strike, all ships must move to the attack orbit. The attack orbit is a circle centered at the origin $(0,0)$ with radius $R$. Because the energy generated by the launch is immense, JYY hopes that the distance between the ships during the launch is as large as possible. Specifically, JYY wants all $n$ ships of the Golden Fleet to be evenly arranged on the attack orbit (all ships are of the same model, so they can be arranged in any order), meaning the distance between adjacent ships along the attack orbit (the arc) is equal and exactly $\frac{2\pi R}{n}$. In other words, JYY wants to adjust the positions of all ships such that all ships are on the attack orbit and they are exactly at the $n$ vertices of a regular $n$-gon.

Please help JYY calculate the minimum time required for the attack to begin (i.e., the minimum time for all ships to move to the attack orbit and be arranged equidistantly). A ship can move a distance of one unit in one unit of time, and the volume of a ship can be considered 0. Therefore, in the plan you design, ships are allowed to "meet" at a certain moment. Additionally, the initial coordinates of the ships are allowed to coincide.

Input

The first line contains two integers $n$ and $R$, representing the number of starships and the radius of the attack orbit. The next $n$ lines each contain two integers $(x_i, y_i)$, representing the coordinates of each starship.

Output

Output a single line representing the minimum time for all ships to be in position (please keep enough decimal places). Your output is considered correct if the difference from the reference answer does not exceed $10^{-6}$.

Examples

Input 1

3 1
0 0
0 0
0 0

Output 1

1.00000000

Input 2

3 10
10 0
0 10
10 10

Output 2

12.17522858

Note

In the optimal solution for Example 2, the ship at $(10,10)$ will move towards the origin to the position $(5\sqrt{2}, 5\sqrt{2})$, and the remaining ships will move in a straight line to the other two symmetric vertices of the equilateral triangle, with a movement distance of $2R \sin \frac{75^\circ}{2} \approx 12.17522858$.

Constraints

For 20% of the data, $n = 3$. For 50% of the data, $n \le 50$. For 100% of the data, $3 \le n \le 200$, $0 \le |x_i|, |y_i|, R \le 100$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.