Splitting the Field

Compute how much fenced area is saved by covering all points with two disjoint axis-aligned rectangles instead of one.

Medium6SortingPrefix sumGeometryInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Farmer John keeps NN cows, and every cow stands at a different position in his two dimensional field. John wants one rectangular fence that encloses all of the cows. Its sides are parallel to the xx and yy axes, and among all rectangles that contain every cow it has the smallest area. A cow on the boundary counts as enclosed.

Milk production dropped last quarter, so the budget is tight. To cut the maintenance cost John wants to build two enclosures instead of one and fence a smaller total area. The two enclosures are also rectangles with sides parallel to the xx and yy axes, together they must contain every cow, and they may not overlap, not even on their boundaries. An enclosure of zero area is allowed, so an enclosure may have zero width or zero height.

Compute the area of the single enclosure minus the smallest possible total area of two enclosures.

Input

The first line contains the number of cows NN. (3N500003 \le N \le 50000)

Each of the next NN lines contains the coordinates xx and yy of one cow, separated by a space. (1x,y1091 \le x, y \le 10^9)

All cow positions are different.

Output

Print one integer, the area John saves by building two enclosures instead of one.