Field Reduction

Remove up to three of N points so the axis-aligned bounding rectangle of the rest has the smallest possible area.

Medium6Brute forceGeometryNo attempts yetTime limit2sMemory limit512 MB

Problem

Farmer John has NN cows (5N500005 \le N \le 50000) standing at distinct positions of a two dimensional field. He wants to enclose all of them with a rectangular fence whose sides are parallel to the xx and yy axes, and he wants that rectangle to be as small as possible while it still contains every cow. A cow standing on the boundary counts as enclosed.

Milk production was low last quarter, so the budget is tight. If selling cows makes the fence smaller, John is willing to sell up to three of them.

Compute the smallest area John can enclose after he removes at most three cows and then builds the tightest rectangle around the ones that remain.

In this problem a cow is a point and the fence is four line segments, so do not think of a cow as a unit square. The answer can be 0, for example when every remaining cow stands on one vertical line or one horizontal line.

Input

The first line contains NN. Each of the next NN lines contains two integers, the xx and yy coordinate of one cow. Every coordinate is an integer between 11 and 4000040000, and no two cows stand at the same position.

Output

Print one integer, the minimum area John can enclose after removing at most three carefully chosen cows.