Josh is playing his favorite game, Legal Legends. In the game, Josh has to command and select units, by drawing a rectangle that contains them. On Josh's screen, there are units, with the unit having the coordinates , Josh is lazy, and does not want to draw larger rectangles than he needs to. Help Josh figure out the minimum area of the rectangle required to contain all the units on his screen. A unit is considered contained in a rectangle if it is either inside the rectangle, or on one of its edges.
Input Specification
The first line contains the integer , the number of units on Josh's screen. The next lines contain integers each, the line containing , , the coordinates of the unit.
Output Specification
Output the minimum area required to contain Josh's units.
Sample Input 1
4
0 2
0 0
2 0
2 2
Sample Output 1
4
Sample Input 2
3
1 2
1 3
1 4
Sample Output 2
0
Comments
CCC stole this problem
This question is almost exactly the same as VM7WC '16 #3 Bronze - Shahir-in-a-Box, which is worth three points.
However, the rectangles in that problem must be axis-aligned, whereas in this problem there is no such constraint.