#P7762. [COCI 2016/2017 #5] Unija
[COCI 2016/2017 #5] Unija
Description
Given rectangles whose geometric centers are at the origin of the Cartesian coordinate system. Paint these rectangles, and find the total painted area.
Input Format
The first line contains an integer .
The next lines each contain two even integers , representing the rectangle’s width and height (corresponding to the horizontal length and the vertical length, respectively).
Output Format
Output the total painted area.
3
8 2
4 4
2 6
28
5
2 10
4 4
2 2
8 8
6 6
68
Hint
[Sample 1 Illustration]

[Constraints]
For of the testdata, all input integers are less than .
For of the testdata, there are no rectangles that contain another.
For of the testdata, , .
[Hints and Notes]
This problem is translated from COCI 2016-2017 CONTEST #5 T3 Unija.
The score of this problem follows the original COCI settings, with a full score of .
Translated by ChatGPT 5
京公网安备 11011102002149号