favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

# Rectangle

On a sheet of paper, devided into square cells, K rectangles are drawn. Their sides lie on grid lines, and the vertices have integer coordinates. Find the rectangle of minimum area that encloses all the given rectangles and which sides are parallel to the grid lines.

Input

The first line contains integer K (1K100). Each of the next K lines contains four integers – the coordinates of two opposite vertices of rectangle (the values are not greater than 105 by absolute value).

Output

The area of the minimum rectangle.

Time limit 1 second
Memory limit 64 MiB
Input example #1
3
2 2 5 6
3 3 7 1
6 4 4 7

Output example #1
30

Source Stage III All-Ukrainian School Olympiad 2011-2012, Round 1, Zhytomyr
Игра с числами