题目描述
Background
Bubu is a master at the game "Bubble Fighter" with nearly perfect records. He excels in many maps, such as "Community 10," "Pirate 14," "Ocean 02," and so on, but his favorite map is "Racing."
In the Racing map, each player gets a car and races from the starting point to see who reaches the finish line first.
Problem Description
In the map, there are obstacles, gas stations, racing tracks, and sandy areas. Obstacles are impassable, and the speed of the car differs on the racing track and sandy areas.
Let's consider a simplified version of the racing game:
- The race takes place on an infinite sandy plane.
- The track is a polyline starting from the origin, consisting of $n$ segments connected end-to-end.
- For safety reasons, the track does not intersect itself (i.e., any two adjacent segments share exactly one point, and any other two segments do not share any points).
- The car's speed on the track is $v_a$, and on the sand is $v_b$, with $v_a \geq v_b$.
- To increase the challenge, driving against the track direction is allowed.
Bubu is a very precise player who can always follow the planned route to the finish line, but he doesn't know which route is the fastest. Can you help him?
Input Format
The first line of the input file racing.in contains an integer $n$, representing the number of segments in the track. The second line contains two real numbers $v_a$ and $v_b$, representing the car's speed on the track and on the sand, respectively.
The next $n$ lines each contain two integers $x_i$ and $y_i$, representing the coordinates of each turning point of the track in sequence. The first segment is from $(0,0)$ to $(x_1, y_1)$, the second segment is from $(x_1, y_1)$ to $(x_2, y_2)$, and so on, with $(x_n, y_n)$ being the finish line.
Output Format
The output file racing.out contains only one real number, representing the minimum time required to travel from the start to the finish line, accurate to six decimal places.
Sample Input and Output
Sample Input #1
2
2 1
0 4
4 4
Sample Output #1
4.000000
Sample Input #2
2
2 1
4 4
4 -4
Sample Output #2
5.464102
Notes
Scoring Criteria
Each set of data is scored individually. For each set of data, your score is calculated using the following formula:
$$YourScore=\begin{cases}10 & |YourAnswer-OurAnswer|\leq 0.0001\\ 5 & |YourAnswer-OurAnswer|\leq 0.01 \\ 0 & Otherwise \end{cases}$$
Data Size
For 20% of the data, the track's polyline is parallel to the coordinate axes.
For 40% of the data, $n \leq 50$.
For 100% of the data, $n \leq 1000$, $1 \leq v_b \leq v_a \leq 20$.
All coordinates are within $[-10^6, 10^6]$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分