#000128

Squares

On a large piece of paper (1000 × 1000 mm) little boy has painted some filled squares. All squares have sides parallel to the sides of the paper, all squares fit inside the paper, some squares may overlap.

What is the total area covered by all the squares?



InputThe first line of each test case contains the number of squares n, 1<=n<=1000. Then the following n lines describe the squares.

Each square is described by the x, y coordinates of the lower-left corner and the length of its sides. The coordinates and lengths are given in milimeters and are integers. The bottom-left corner of the paper has coordinates (0, 0).


OutputFor each test case output the total area covered by the squares.



Sample input
2
0 0 3
2 2 3

Sample output
17

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.