Aquarium Tank
Time limit1sMemory limit256 MB
A convex polygon tank of depth D holds L litres of water, and the task asks for the height of the water surface.
- Level
Medium6 of 10
- Topics
- Geometry, Binary search
- Solved
- No attempts yet
Problem
You bought an aquarium tank with an unusual shape and poured litres of water into it. How high does the water stand in the tank?
Seen from one side, the tank is a convex polygon. Exactly two vertices of that polygon rest on the table, so their coordinates are 0, and every other vertex has a positive coordinate. Exactly two vertices have the maximum coordinate, and the water is poured through the opening between those two vertices. The tank is centimetres deep. It is glued to the table, so whatever its shape is, it keeps its position and does not tip over.
All coordinates and lengths in this problem are given in centimetres. One cubic metre is 1000 litres.
Input
The input is a single test case. The first line contains an integer (), the number of vertices of the polygon. The second line contains two integers and , where is the depth of the tank and is the number of litres of water poured into it. Each of the next lines contains two integers, the and coordinates of one vertex of the convex polygon, in counterclockwise order. The absolute values of and are at most 1000. The tank has a positive capacity, and the water poured in never exceeds it.
Output
Print the height of the water in the tank, in centimetres, rounded to 2 decimal places, on one line.