The Elric brothers, Edward and Alphonse, have suspicions of sinister, illegal experiments occurring in the "abandoned" 5th Laboratory given by coordinates
Driven by their pursuit of the truth, the boys construct a risky plot: while their allies distract the guards, they will stealthily infiltrate the lab from a hiding spot.
To ensure their success, they turn to you, an expert state programmer working alongside alchemists. Your task is to compute the minimum time
There are
When on equal elevation as the lab, the boys can run at a speed of
The boys can only glide, as free falling is not stylish. However, they do not necessarily need to glide straight.
In addition, the boys can only carry either gliders or climbing gear, but not both, as carrying both would be too heavy (Edward is too weak).
Constraints
Input Specification
The first line contains three integers,
The second line contains a positive integer
The next
Output Specification
Output a single line containing a single number: the minimum time needed to reach the lab.
Note: Outputs within
Sample Input 1
1 1 1
2
5 4 1
1 2 -5
Sample Output 1
2.5
Explanation for Sample 1
The first hiding spot, the brothers run
The second hiding spot, the brothers climb for
The faster of the two being
Sample Input 2
1 1 1
2
1 2 1
1 1 1
Sample Output 2
0
Explanation for Sample 2
The optimal hiding spot is already in the lab.
Sample Input 3
0 0 0
2
0 7 4
0 3 8
Sample Output 3
2
Explanation for Sample 3
The first and second hiding spots take
Comments