Problem D : Slides
There are N slides lying on the table. Each of them is transparent and formed as a rectangle. In a traditional problem, one may have to calculate the intersecting area of these N slides. The definition of intersection area is such area which belongs to all of the slides.
But this time I want to take out some one of the N slides, so that the intersecting area of the left N-1 slides should be maximal. Tell me the maximum answer.
INPUT:
The first line of the input contains a single integer T, which is the number of test cases.
The following lines contain the input data for each test case. The first line of each test case contains a single integer N (1<=N<=100) , the number of rectangles. Followed by N lines, each line contains four integers x1 , y1 , x2 , y2 ( -10000 <= x1 < x2 <= 10000, -10000 <= y1 < y2 <= 10000) , pair (x1, y1) gives out the bottom-left corner and pair (x2, y2) gives out the top-right corner of the rectangle.
OUTPUT:
There should be one line per test case containing the maximum intersecting area of corresponding N-1 slides.
Time limit: 3 seconds