Intersecting rectangles Consider, in 2D space, a set of rectangles with edges parallel to the axes. Your job is to evaluate the area covered by the rectangles. Each rectangle is characterized by the area of its bottom-left and upper-right corners. The maximum number of rectangles is 500. You may assume that there is no coincidence between edges of one rectangle and vertices of another. Input The input begins with a single positive integer on a line by itself indicating the number of cases. The next line has a single number n -- the number of rectangles in the case. The next n lines each have 4 four integers specifying a rectangle as indicated before. Output For each case output the area covered by the rectangles. Sample Input 2 3 0 0 2 2 1 1 4 4 3 0 5 2 4 0 0 10 10 6 6 16 16 12 0 22 10 6 -6 16 4 Sample Output 15 336