题目描述
Problem Description
There is a circular moving walkway at Takabayashi Airport with a circumference of $ L $, and its floor moves at a speed of $ X $ per second in a clockwise direction. The position of a point on the circular walkway is represented by the distance measured clockwise from the northernmost point (ranging from $ 0 $ to $ L-1 $). There is an exit at a point on the outer circumference at position $ D $, allowing one to exit the moving walkway. The outer and inner perimeters have handrails, so Takahashi cannot exit the walkway from any place other than the exit.
Takahashi can walk on the moving walkway's floor at a speed of $ Y $ per second in either a clockwise or counterclockwise direction, and he is currently at position $ S $ on the walkway.
Calculate the minimum time it takes for Takahashi to reach the exit.
Note that since there is only one exit on the moving walkway, and no one but Takahashi would intentionally ride it, walking against the direction of the walkway does not bother anyone.
Input Format
The input is given from the standard input in the following format:
$ L $ $ X $ $ Y $ $ S $ $ D $
Output Format
Output the minimum time it takes for Takahashi to reach the exit in one line. The answer will be accepted if the absolute or relative error is at most $ 10^{-6} $.
Do not forget to add a newline at the end of the output.
Sample Input and Output
Sample Input #1
6 2 3 1 5
Sample Output #1
0.8000000000
Sample Input #2
6 2 10 1 5
Sample Output #2
0.2500000000
Sample Input #3
6 3 1 5 3
Sample Output #3
1.0000000000
Sample Input #4
10 7 7 6 0
Sample Output #4
0.2857142857
Notes/Hints
Constraints
- $ 1 ≦ L, X, Y ≦ 10^9, 0 ≦ S, D ≦ L-1 $
- All inputs are integers.
Sample Explanation 1
Continuing to walk clockwise, Takahashi can reach the exit in $ 0.8 $ seconds.
Sample Explanation 2
Continuing to walk counterclockwise, Takahashi can reach the exit in $ 0.25 $ seconds.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分