#P10742. [SEERC 2020] Simple Hull
[SEERC 2020] Simple Hull
Problem Description
Gary created a polygon with points, where each point has coordinates of the form .
You need to add some edges so that all points are included, and the resulting graph is a "polygonal chain" (that is, each point can be connected to or be connected from at most points, and the drawn edges are allowed to intersect other edges in the graph).
You also need to ensure that for every two points and that are connected by an edge, the edge formed by these two points is vertical or horizontal in the graph.
Output the minimum possible area of the resulting graph.
Input Format
The first line contains an integer , the number of points.
Then follow lines, each containing two integers .
Output Format
Output the area of the resulting -gon.
6
1 1
6 1
6 11
11 11
11 6
1 6
50
8
2 4
2 1
4 1
4 3
1 3
1 2
3 2
3 4
6
10
1 1
1 5
4 5
4 3
2 3
2 4
1 4
1 2
4 2
4 1
8
Hint
The graphs drawn for the three samples are, in order:

(The above figures are not drawn to scale.)
Translated by ChatGPT 5