Damaged Picture
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Roman figure , which stood on the floor of the room in point with coordinates 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 . In the room stood vertical paper picture. You know coordinates of bottom parts and and height of picture .
Find the length "tear up of paper" on the picture.
Input
For input you have 9 numbers , , , , , , , , . All input data is integer numbers, which module not exceeds .
Output
The program gives you one number. It is value with precision to which you find.
Examples
Input #4
Answer #4
Submissions 5K
Acceptance rate 20%