#P7270. [BalticOI 2002] Triangles (Day1)

[BalticOI 2002] Triangles (Day1)

Description

You are given nn isosceles right triangles. Each triangle is generated from a point (xi,yi)(x_i, y_i) by extending two perpendicular legs of length mim_i upwards and to the right.

Find the total area covered by these triangles.

Input Format

The first line contains an integer nn, the number of triangles.
The next nn lines each contain three integers xi,yi,mix_i, y_i, m_i describing one triangle.

Output Format

Output one real number, the answer.
Keep only one digit after the decimal point.

5
-5 -3 6
-1 -2 3
0 0 2
-2 2 1
-4 -1 2 
24.5

Hint

Sample Explanation

For sample 11, the 55 triangles are as follows:

Constraints

For 100%100\% of the testdata, 1n20001 \le n \le 2000, 107xi,yi107-10^7 \le x_i, y_i \le 10^7, 0m10000 \le m \le 1000.

Note

Translated from BalticOI 2002 Day1 C Triangles.

Translated by ChatGPT 5