406148: GYM102279 F Flood Season

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Flood Seasontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Poor them!

Whenever rain season comes, the water rises as hell and the most affected region is Northwest Vietnam. Villages, houses, plants, animals, and people are all victims of cruel Nature.

S_e_o is a civil manager of Northwest Vietnam. As a man with a kind heart, he worries for Northwestern citizens and is willing to do everything to stop the disaster. With only a computer, he roughly models the area of Northwest Vietnam on Cartesian plane. The model is a polyline with n points, each with integer coordinates. He wants to calculate the maximum area that could be filled with water, but his computer breaks down right after he has finished the model. He still keeps the input data and calls for your help!

Please help him !!

Input

The first line contains an integer $$$\ n\ (2\le n\le {10}^5)$$$ , the number of points in the polyline

Line 2..$$$\ n+1$$$ : Line $$$i$$$ contains two numbers $$$x_i,\ y_i(0\le x_i,\ y_i\le {10}^6)$$$ which are x-coordinates and y-coordinates of a point.

It is guaranteed that $$$x_i<x_{i+1}$$$

Output

Output: A single line contains a single real number which is the answer. Your output is correct if the difference between your output and the test answer is no larger than $$${10}^{-6}$$$

ExampleInput
7
1 1
2 0
3 1
5 5
7 2
8 3
9 0
Output
1.8333333
Note

The following image explains the first sample test case

加入题单

算法标签: