402904: GYM100942 E The Carpet
Description
A perfectly round crater was found on a distant planet. Two stations arrived to study the crater. In order to start exploration, it is necessary to lay a special carpet roll on the surface, so that the rovers will use it to move around. It is possible to unroll the carpet all over the surface except for the crater area. The rovers must be able to move on the carpet roll from one station to another and to the crater’s edge. Carpets are very expensive in Space, that's why it is necessary to make the carpet roll's length as short as possible.
InputThe first line contains two pairs of Cartesian coordinates of the stations separated by space. The second line contains coordinates of the center and the crater's radius. All numbers are integers and do not exceed 40000 by absolute value. It is guaranteed that the stations are outside the crater.
OutputOutput the total length of the carpet roll with absolute or relative error that does not exceed 10 - 6.
ExamplesInput3 4 4 4Output
0 0 5
1.000000