In geometry, a convex polygon is a polygon that is the boundary of a convex set. This means that the line segment between two points of the polygon is contained in the union of the interior and the boundary of the polygon. In particular, it is a simple polygon (not self-intersecting). Equivalently, a polygon is convex if every line that does not contain any edge intersects the polygon in at most two points.
You are given $$$n$$$ distinct points $$$p_1,p_2,\dots,p_n$$$ on the 2D plane. It is guaranteed that all points are distinct and no three points are collinear.
A fence can be regarded as a convex polygon such that:
The profit of the fence $$$F$$$ comes from the points on the boundary or inside it. Formally: $$$$$$\text{Profit}(F)=\sum_{p_i\text{ is on the boundary of }F}a_i+\sum_{p_i\text{ is strictly inside }F}b_i$$$$$$
You are required to build exactly two fences $$$A,B$$$ such that:
There is only one test case in each test.
The test case starts with a line containing a single integer $$$n$$$ ($$$6 \leq n \leq 100$$$), denoting the number of points.
Each of the next $$$n$$$ lines contains four integers $$$x_i,y_i,a_i$$$ and $$$b_i$$$ ($$$1\leq x_i,y_i\leq 10^9$$$, $$$1\leq a_i,b_i\leq 10^6$$$), describing the $$$i$$$-th point $$$p_i$$$ located at $$$(x_i,y_i)$$$.
It is guaranteed that no two points are identical and no three points are collinear.
Print a single line containing a single integer, denoting the maximum possible value of $$$\text{Profit}(A)\cdot\text{Profit}(B)$$$. You can assume that the answer always exists.
91 1 10 110 1 10 110 10 10 11 10 10 12 3 1 10104 102 10 1106 102 10 1105 109 10 1105 108 1 10
2000