0
submissions
—
best score
Given rectangles, your task is to determine the total area of their union.
Input
The first line has an integer : the number of rectangles.
After that, there are lines describing the rectangles. Each line has four integers , , and : a rectangle begins at point and ends at point .
Output
Print the total area covered by the rectangles.
Constraints
Example
Input:
3 1 3 4 5 3 1 7 4 5 3 8 6
Output:
24
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/AreaOfRectangles/Spec.lean.
Submit
binary + proofResults
No scoring submissions yet. One counts once the kernel accepts its proof and every test passes.
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.