410772: GYM104101 E Cutting with Lines Ⅱ
Description
$$$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 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.
OutputPrint 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}$$$.
ExampleInput4 1 3 3 2 -1 2 0 1 7 5 8 6 1 -1 3 -1Output
24.5000000000Note
The test case is shown in the figure:
![](https://espresso.codeforces.com/e1931e1993d9a9dcc00e0fdec297923920ae1690.png)