L-Shape Covering
Time limit1sMemory limit128 MB
Find the minimum area of an axis-aligned L-shape with its top-right corner cut away covering all given points.
Problem
An L-shape is an axis-aligned rectilinear hexagon with exactly one reflex corner: it is the smallest bounding rectangle of the shape with only its top-right corner cut away. See Figures (a) and (b). The cut may degenerate so that three corners become collinear, as in Figure (b).

Figure (a)

Figure (b)
Given a set of points in the plane, an L-shape is said to cover the points if every point lies inside it or on its boundary. Write a program that computes the area of the smallest L-shape covering all of the given points.

Figure (c)

Figure (d)
Figure (c) shows a set of points, and Figure (d) shows the minimum-area L-shape that covers them.
Note that the resulting area may be , and the input may contain several points with identical coordinates.
Input
The first line contains the number of test cases ().
Each test case begins with a line containing the number of points (). Each of the next lines contains the two integer coordinates of one point separated by a single space; each coordinate is an integer between and .
Output
For each test case, print a single line containing the area of the smallest L-shape that covers the given points.