Tears in rain P40040


Statement
 

pdf   zip

thehtml

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.

Roy Batty has died. A starship will transport his body from the Tannhäuser Gate to the shoulder of Orion. Assume a two-dimensional universe, centered at the middle of Orion. The shoulder of Orion orbits around its center as a circumference. Its position as a function of the time t ≥ 0 is (R cost, R sint). The Tannhäuser Gate is located at (Tx, Ty). The starship can freely change its speed and direction, with just one restriction: a maximum absolute speed of S.

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.

Public test cases
  • 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
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++