Solution Notes: There are several ways to approach this problem. One common type of solution is a "sweep line" approach, described in the analysis of the silver version of this problem (along with code for the solution). Another approach is to extend every line segment in our scene, creating a grid of horizontal and vertical lines (the grid is easy to loop over if we first sort all the x and y coordinates in the scene). For each rectanglular cell in the grid, we add its area into the total if some rectangle overlaps that cell (and this is easy to check by looping over all the rectangles in the input). For the mathematically inclined, the problem can also be solved via the principle of inclusion-exclusion: loop over all 2^N subsets of rectangles, compute the area A of the intersection of the rectangles in each subset, and either add this area to the total if the subset contains an odd number of rectangles, or subtract it from the total if the subset contains an even number of rectangles (i.e., add the areas of all single rectangles, then subtract the areas of all pairwise intersections, then add back in the areas of all 3-wise intersections, etc.)