Problem D
Aquarium Tank

You just bought an “artistic” aquarium tank that has an
interesting shape, and you poured
When you look at this tank from one side, it has the shape
of a convex polygon. This polygon has exactly two vertices on
the table (
All coordinates and lengths in this problem are given in centimetres. It should be noted that each cubic metre is equivalent to 1 000 litres.
An illustration showing the configuration of the tank of the first sample input is given below:
![\includegraphics[scale=0.5]{Diagram1.png}](/problems/tank/file/statement/en/img-0002.png)
Input
The input consists of a single test case. The first line
contains an integer
Output
Print the height of the water (in centimetres) in the aquarium tank on a line to 2 decimal places.
Sample Input 1 | Sample Output 1 |
---|---|
4 30 50 20 0 100 0 100 40 20 40 |
20.83 |
Sample Input 2 | Sample Output 2 |
---|---|
9 30 70 110 70 100 80 80 80 -10 60 -40 30 -40 25 20 0 100 0 120 10 |
19.74 |