QOJ.ac

QOJ

実行時間制限: 3 s メモリ制限: 128 MB 満点: 100

#13265. Crazy Racing

統計

Bubu is a master of the game "Crazyracing Kartrider" and holds a near-perfect record. He is skilled in many maps, such as "Neighborhood 10", "Pirate 14", "Ocean 02", etc., but his favorite map is "Racing".

In the racing map, each player is given a racing car and starts from the starting point, competing to see who reaches the finish line first.

The map contains obstacles, gas stations, race tracks, and sandy areas. Obstacles are impassable, and the speed of the car on the race track and in the sandy area is different.

Now, let us consider a simplified version of this racing game. In this simplified version: The race is held on an infinitely large sandy plane. The race track is a polyline starting from the origin, consisting of $n$ line segments connected end-to-end. For safety reasons, the track does not self-intersect (i.e., any two line segments in the polyline have at most one common point, which is the shared endpoint for adjacent segments; any other two segments have no common points). The speed of the car on the track is $v_a$, and the speed in the sandy area is $v_b$, satisfying $v_a \ge v_b$. * To increase the challenge, driving in reverse on the track is allowed.

Bubu is a very precise player who can always follow his intended path to the finish line, but he does not know which route is the fastest. Can you, the clever one, help him?

Input

The first line contains an integer $n$, representing that the track has $n$ segments. The second line contains two real numbers $v_a$ and $v_b$, representing the speed of the car on the track and in the sandy area, respectively.

The next $n$ lines each contain two integers $x_i$ and $y_i$, representing the turning points of the track in order. That is, the first segment of the track is $(0,0) \to (x_1, y_1)$, the second segment is $(x_1, y_1) \to (x_2, y_2)$, and so on. $(x_n, y_n)$ is the finish line.

Output

The output should contain a single real number representing the minimum time required to travel from the start to the finish. The result should be accurate to 6 decimal places.

Examples

Input 1

2
2 1
0 4
4 4

Output 1

4.000000

Input 2

2
2 1
4 4
4 -4

Output 2

5.464102

Subtasks

Each test case is scored individually. For each test case, your score is calculated according to the following formula:

$$ YourScore = \begin{cases} 10 & |YourAnswer - OurAnswer| \le 0.0001 \\ 5 & |YourAnswer - OurAnswer| \le 0.01 \\ 0 & Otherwise \end{cases} $$

Constraints

  • For 20% of the data, the segments of the track are parallel to the coordinate axes.
  • For 40% of the data, $n \le 50$.
  • For 100% of the data, $n \le 1000$, $1 \le v_b \le v_a \le 20$.
  • All coordinates are within $[-10^6, 10^6]$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.