#P4166. Maximum Area Quadrilateral

    ID: 17414 Type: Default 1000ms 256MiB

Maximum Area Quadrilateral

Maximum Area Quadrilateral

Given a set of N points in the plane, you are allowed to choose any four points to form a quadrilateral. The quadrilateral is constructed by sorting the chosen four points in counterclockwise order using the center of the four points. Your task is to determine the maximum possible area of such a quadrilateral.

More formally, let the four chosen points be \(P_1=(x_1,y_1)\), \(P_2=(x_2,y_2)\), \(P_3=(x_3,y_3)\), and \(P_4=(x_4,y_4)\). Compute the center point as \(C=(\frac{x_1+x_2+x_3+x_4}{4},\frac{y_1+y_2+y_3+y_4}{4})\) and then sort these four points by the angle \(\theta = \arctan\frac{y- C_y}{x - C_x}\). The area of the quadrilateral is then given by the shoelace formula: \[ \text{Area} = \frac{1}{2}\left|\sum_{i=1}^{4}(x_i y_{i+1} - x_{i+1} y_i)\right| \] with \(P_5=P_1\). Your goal is to find the maximum area among all possible choices of four points.

inputFormat

The first line contains an integer N representing the number of points.

Each of the following N lines contains two space-separated integers \(x\) and \(y\) representing the coordinates of a point.

It is guaranteed that \(4 \leq N \leq 50\).

outputFormat

Output a single number, which is the maximum area of a quadrilateral that can be formed by any four of the given points. The answer will be accepted if it has an absolute or relative error of at most \(10^{-6}\).

sample

4
0 0
0 1
1 1
1 0
1.0

</p>