You are given a list of rectangles where each rectangle is represented by an array of four integers (i.e. Rectangle[i]=[x1, y1, x2, y2], where x1, y1 represents the bottom left point of the rectangle and x2.y2 represents the top right point of the rectangle, you have to find the total area covered by all the rectangles in the plane.
Example :
Rectangles = [[0, 0, 2, 2], [1, 0, 2, 3],[1, 0, 3, 1]],
For the given three rectangles, you can observe that the first rectangle occupies an area of 4 units and the second rectangle has an area of 3 units, but we have to keep one thing also in mind that they have an area of 3 units common overlapping among them, so we cannot include it again, so the final area which comes out for all the rectangles is 6 units.
Total Area = 6 units

The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first line of each test case contains an integer N representing the size of the Array of rectangles.
The next N lines consist of 4 integers representing the bottom left and top right coordinate points of each rectangle.
Output Format :
For each test case, return the area of all the rectangles. To avoid any overflows, return the answer Modulo 10^9+7.
You do not need to take input or print anything. This already has been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <=200
0 <= x1, y1, x2 , y2 <= 10^9 where x1.y1 is the bottom left coordinate of rectangle and x2,y2 is top right corner of rectangle.
Time Limit 1 second.
2
3
0 0 2 2
1 0 2 3
1 0 3 1
2
0 0 2 2
3 0 4 4
6
8
Test Case 1
The first rectangle occupies an area of 4 units and the second rectangle has an area of 3 units but we have to keep one thing also in mind that they have an area of 3 units common overlapping among them, so we cannot include it again, so the final area which comes out for all the rectangles is 6 units.

Test Case 2
There is no overlapping for the two rectangles hence the area is
4 + 4 = 8 units

2
2
0 0 1 2
1 1 3 6
1
0 0 4 4
12
16
As Rectangle points range to 10^9 , think of using coordinate compression with brute force.
O(N^3) where N is the number of rectangles.
For filling the grid we have to iterate over all rectangles and another two nested loops going over all rectangular x points and y points which totally accounts for O(N^3)
O(N^2) where N is the number of rectangles
For making our grid after compressing points it accounts for 2d array which takes O(N^2) Space.