410772: GYM104101 E Cutting with Lines Ⅱ

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

Description

E. Cutting with Lines Ⅱtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

$$$333lfy$$$ has $$$n$$$ straight lines with infinite length. Now he's going to put them in a 2D plane.

$$$333lfy$$$ wants you to select some lines from the given lines to form a convex polygon with the largest area. You just have to tell him the area of this convex polygon.

A convex polygon is a polygon having no internal angles greater than $$$180$$$ degrees. For example, the polygon in the left picture is a convex polygon, but the polygon in the right picture is not.

The left one is a convex polygon, but the right one is not.
Input

The first line of the input contains one integer $$$n$$$ $$$(3 \le n \le 500)$$$ — The number of the straight lines.

The next $$$n$$$ lines each line contains four integers $$$x_1, \ y_1, \ x_2, \ y_2$$$ $$$(-1000 \le x_1, y_1, x_2, y_2 \le 1000)$$$ — A straight line passing through points $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$. It is guaranteed that these two points are different.

It is guaranteed that these straight lines can form at least one convex polygon.

Output

Print a real number — the number satisfying the conditions above.

Your answer is acceptable if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally speaking, suppose that your output is $$$x$$$ and the jury's answer is $$$y$$$; your output is accepted if and only if $$$\frac{|x - y|}{max(1, |y|)} \le 10^{-6}$$$.

ExampleInput
4
1 3 3 2
-1 2 0 1
7 5 8 6
1 -1 3 -1
Output
24.5000000000
Note

The test case is shown in the figure:

testcase

加入题单

算法标签: