A. Two Fences
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

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 area is positive.
  • Each endpoint of any edge belongs to the given set of points.

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:

  • $$$\text{Profit}(A)\cdot\text{Profit}(B)$$$ is maximized.
  • Two fences can not be overlapped or nested. They must share no common vertices.
Input

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.

Output

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.

Example
Input
9
1 1 10 1
10 1 10 1
10 10 10 1
1 10 10 1
2 3 1 10
104 102 10 1
106 102 10 1
105 109 10 1
105 108 1 10
Output
2000