Construction
The city administration is in the process of selecting a location for new sports facilities. Several projects are being considered, each requiring a rectangular plot of land. Some of these plots are partially or fully occupied by private individuals. If a project is approved, the administration will need to purchase these plots. Therefore, it's essential to calculate the area of overlap between the plots to estimate the cost. The privately owned plots are also rectangular, and all plot sides are parallel to the coordinate axes. For each project, a plan has been created that includes the selected plot and its surroundings. The example provided illustrates the intersections of private plots (thin line) with the plot chosen for construction (thick line). Your task is to determine the area of intersection for each selected construction plot with the private plots.
Input
The first line of the input file contains the number K – the number of plots selected for construction. The plan for each plot is described as follows: the first line of the description contains the number N - the number of private plots shown on the plan. This is followed by N lines with the coordinates of two opposite vertices of these rectangular plots. The last line of the plan contains the coordinates of the plot selected for construction. The coordinates of a rectangle are described in the format X_1 Y_1 X_2 Y_2. The vertex coordinates are whole, non-negative numbers not exceeding 100. The number of given rectangles does not exceed 20.
Output
For each test case, output a line containing the area of intersection of the rectangles.