#icpc2016autumng. [icpc2016autumn_g]Share the Ruins Preservation

[icpc2016autumn_g]Share the Ruins Preservation

MathJax.Hub.Config({ tex2jax: { inlineMath: [["","",""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }

Problem Statement

Two organizations International Community for Preservation of Constructions (ICPC) and Japanese Archaeologist Group (JAG) engage in ruins preservation. Recently, many ruins were found in a certain zone. The two organizations decided to share the preservation of the ruins by assigning some of the ruins to ICPC and the other ruins to JAG.

Now, ICPC and JAG make a rule for assignment as follows:

  1. Draw a vertical straight line from the north to the south, avoiding to intersect ruins.
  2. Ruins located to the west of the line are preserved by ICPC. On the other hand, ruins located to the east of the line are preserved by JAG. (It is possible that no ruins are located to the east/west of the line; in this case, ICPC/JAG will preserve no ruins.)

A problem is where to draw a straight line. For each organization, the way to preserve its assigned ruins is to make exactly one fence such that all the assigned ruins are in the region surrounded by the fence. Furthermore, they should minimize the length of such a fence for their budget. If the surrounded areas are vast, expensive costs will be needed to maintain the inside of areas. Therefore, they want to minimize the total preservation cost, i.e. the sum of the areas surrounded by two fences. Your task is to write a program computing the minimum sum of the areas surrounded by two fences, yielded by drawing an appropriate straight line.


Input

The input consists of a single test case.

NN
x_1x\_{1} y_1y\_{1}
...
x_Nx\_{N} y_Ny\_{N}

The first line contains an integer NN (1leNle100,0001 \\le N \\le 100{,}000), which is the number of founded ruins. The following NN lines represent the location of the ruins. The ii-th line of them consists of two integers x_ix\_i and y_iy\_i, which indicate the location of the ii-th ruin is x_ix\_i east and y_iy\_i north from a certain location in the zone. You can assume the following things for the ruins:

  • 109lex_i,y_ile109-10^9 \\le x\_i, y\_i \\le 10^9
  • You can ignore the sizes of ruins. That is, you can assume ruins are points.
  • No pair of ruins has the same location.

Output

Print the minimum total preservation cost yielded by drawing an appropriate straight line. You should round off the cost to the nearest integer.



Sample Input 1

8
-10 0
-10 5
-5 5
-5 0
10 0
10 -5
5 -5
5 0```

### Output for the Sample Input 1

```plain
50```

* * *

### Sample Input 2

```plain
5
0 0
0 1
0 2
1 0
1 1```

### Output for the Sample Input 2

```plain
0```

* * *

### Sample Input 3

```plain
6
1 5
1 6
0 5
0 -5
-1 -5
-1 -6```

### Output for the Sample Input 3

```plain
6```

* * *

### Sample Input 4

```plain
10
2 5
4 6
9 5
8 8
1 3
6 4
5 9
7 3
7 7
3 9```

### Output for the Sample Input 4

```plain
17```

* * *