2019 is the death year of Roy Batty, the leader of the renegade Nexus-6 replicants of the cult film Blade Runner. Also, 2019 has been the death year of Rutger Hauer, the actor that so brillianty played the role of Roy Batty on film. That sad coincidence deserves a problem.
Your task is to compute the minimum time to transport Roy’s body from the Tannhäuser Gate to the shoulder of Orion. Consider all objects as points.
Input
Input consists of several cases, each with four real numbers R, Tx, Ty and S. You can assume 0 < R < S.
Output
For each case, print the answer with four digits after the decimal point. The input cases have no precision issues.
Input
100 1356.6371 0 200 10 0 1000 100.5475 1 0 0 2 14.92 -15.75 38.83 18.87
Output
6.2832 10.0000 0.5000 1.5340