#P1222. 三角形

三角形

Description

Given nn isosceles right triangles on the plane. Each triangle is described by three integers x,y,mx, y, m. The three vertices of a triangle are (x,y)(x, y), (x+m,y)(x + m, y), (x,y+m)(x, y + m).

Your task is to compute the total area covered by these triangles.

Input Format

The first line contains an integer nn.

Each of the next nn lines describes a triangle with three integers xi,yi,mix_i, y_i, m_i.

Output Format

Output a single real number with one digit after the decimal point, representing the total area.

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

24.5

Hint

Sample explanation:

Constraints: 1n20001 \le n \le 2000, 1in1 \le i \le n, 107xi,yi107-10^7 \le x_i, y_i \le 10^7, 1mi10001 \leq m_i \le 1000.

Translated by ChatGPT 5