Injured Picture

Roman figure I, which stood on the floor of the room in point with coordinates X0, Y0, 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 Õ1, Y1, 0. In the room stood vertical paper picture. You know coordinates of bottom parts X2, Y2, 0 and X3, Y3, 0 and height of picture H.
Find the length "tear up of paper" on the picture.
Specifications
Input
For input you have 9 numbers X0, Y0, X1, Y1, X2, Y2, X3, Y3, H. All input data is integer numbers, which module not exceeds 109.
Output
The program gives you one number. It is value with precision to 0.001 which you find.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 71% 37/129
Autor: Prysyashnjuk A.W.
Classes: Geometry
Example
Example input1 1 6 1 4 0 4 5 6 |
Example output4.000 |
| ← Big accuracy | Problems | Spider and Fly → |
