Professor Oak is reforming his flat. He asks for a ceiling shower (consider it a point) in the middle of a 140 × 90 rectangular space. The start of the water pipe (a straigh line) must be located at a corner of the rectangle. Instead of using the Pythagoras’ theorem and cutting a pipe of length √702 + 452 ≃ 83.22, the plumber arbitrarily decides to cut a pipe of length 75. Therefore, the shower cannot be placed in the middle of the rectangle, so the goal is to minimize the uglyness of the shower, defined as the Manhattan distance between the shower and the center of the rectangle.
[fillcolor=yellow,fillstyle=solid](0,0)(14,0)(14,9)(0,9)
linewidth=2
linecolor=black (0,0)(7,4.5)
linecolor=red (0,0)(6,4.5)
Can you help Prof. Oak to minimize the uglyness? He is so desperate with the reform of his flat that he does not even require the shower to be inside the rectangle.
Input
Input consists of several cases, each one with three strictly positive real numbers h, v and ℓ, corresponding to the dimensions h × v of the rectangle and the length ℓ of the pipe.
Output
For each case, print the minimum possible uglyness with four digits after the decimal point. To do so, include these two lines at the beginning of your main:
cout.setf(ios::fixed); cout.precision(4);
The input cases do not have precision issues.
Input
140 90 75 140 90 83.21 60 80 40 60 80 50 60 80 60 2.718 3.142 23.42 0.8 0.7 0.9
Output
10.0000 0.0078 13.4315 0.0000 11.9615 21.8095 0.4292