Area of Rectangles
Given n rectangles, your task is to determine the total area of their union. Input The first line has an integer n: the number of rectangles. After that, there are n lines describing the rectangles. Each line has four integers x_1, y_1, x_2 and y_2: a rectangle begins at point (x_1,y_1) and ends at point (x_2,y_2). Output Print the total area covered by the rectangles. Constraints - 1 \le n
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start