#P5490. 【模板】扫描线 & 矩形面积并
【模板】扫描线 & 矩形面积并
Problem Description
Find the union area of rectangles whose sides are parallel to the coordinate axes.
Input Format
The first line contains a positive integer .
The next lines each contain four non-negative integers , indicating that the four vertices of a rectangle are , , , .
Output Format
Output one positive integer in a single line, representing the total area covered by the union of the rectangles.
2
100 100 200 200
150 150 250 255
18000
Hint
For of the testdata, .
For of the testdata, , , .
Updated on 4.10 by Dengduck (kouhu) & yummy (implementation): one more test case was added.
Translated by ChatGPT 5