eolymp
bolt
Try our new interface for solving problems
Problems

Injured Picture

Injured Picture

Roman figure $I$, which stood on the floor of the room in point with coordinates $X_0, Y_0, 0$ and did not endure a relation to answer of problem of "Roman numerals". It flowed on the floor. Just as a bottom part of the Roman figure was fasted hinge, so it stayed at the place without change, but the top part of the Roman figure found oneself in point with coordinates $X_1, Y_1, 0$. In the room stood vertical paper picture. You know coordinates of bottom parts $X_2, Y_2, 0$ and $X_3, Y_3, 0$ and height of picture $H$. Find the length "tear up of paper" on the picture. \includegraphics{https://static.e-olymp.com/content/68/68cd45f7450b5e15965cb9856d6a35ebb4f2b602.jpg} \InputFile For input you have 9 numbers $X_0$, $Y_0$, $X_1$, $Y_1$, $X_2$, $Y_2$, $X_3$, $Y_3$, $H$. All input data is integer numbers, which module not exceeds $10^9$. \OutputFile The program gives you one number. It is value with precision to $0.001$ which you find.
Time limit 1 second
Memory limit 64 MiB
Input example #4
1 1 6 1 4 0 4 5 6
Output example #4
4.000
Author Prysyashnjuk A.W.