Field Reduction (Silver)#10571

Field Reduction (Silver)

1 second
128 megabytes
Hard

Farmer John's cows are all located at distinct positions in his two-dimensional field. FJ wants to enclose all of his cows with a rectangular fence whose sides are parallel to the - and -axes. He wants the fence to be as small as possible while still containing every cow, with cows on the boundary allowed.

Unfortunately, FJ is on a tight budget due to low milk production last quarter. He would therefore like to make the fenced enclosure even smaller if possible, and he is willing to sell up to three cows from his herd to achieve this.

Please help FJ determine the minimum possible area he can enclose with his fence after removing up to three cows from his herd and then building the smallest possible enclosing rectangle around the remaining cows.

For this problem, treat cows as points and the fence as a collection of four line segments (that is, do not think of the cows as "unit squares"). Note that the answer can be zero; for example, this occurs if all remaining cows lie on a common vertical or horizontal line.

Input

The first line contains an integer n~(5 \le n \le 50000). The next lines each contain two integers specifying the location of a cow. Cow locations are positive integers in the range from to .

Output

Print one integer representing the minimum area FJ can enclose with his fence after removing up to three carefully chosen cows from his herd.

Examples

Example 1

Loading
Loading