poly.in
poly.out
In a 2-dimensional plane, a rectilinear polygon is a polygon whose line segments are either horizontal or vertical. A general rectilinear polygon is one whose line segments can cross each other, and a simple rectilinear polygon is one whose line segments do not cross each other.
The polygon considered in this problem is a general rectilinear polygon that satisfies the following conditions.
A rectilinear polygon satisfying the above conditions divides a plane into many simple rectilinear polygons.
For instance, the following figure shows a general rectilinear polygon consisting of 14 line segments. Aside from the outside of the polygon, the general polygon divides the plane into 6 simple rectilinear polygons A, B, C, D, E, and F, of which F has the largest area.

Given a general rectilinear polygon, write a program to compute the area of the largest among simple rectilinear polygons defined by the general rectilinear polygon.
The first line of the input file contains an integer N (4 ≤ N ≤ 1000), the number of vertices of a general rectilinear polygon. Each of the following N lines consists of the x and y coordinates (0≤x, y≤10,000) of a vertex. To construct the general rectilinear polygon for the input data, connect two consecutive vertices with a line segment, and connect the last vertex to the first vertex with a line segment.
The first and only line of the output file must contain one integer, the area of the largest among the simple rectilinear polygons defined by the general rectilinear polygon given in the input file.
14 1 7 2 7 2 6 7 6 7 2 3 2 3 7 6 7 6 3 11 3 11 1 5 1 5 4 1 4
10