P1222 Triangle

Description

Given $n$ isosceles right triangles on the plane. Each triangle is described by three integers $x, y, m$. The three vertices of a triangle are $(x, y)$, $(x + m, y)$, $(x, y + m)$. Your task is to compute the total area covered by these triangles.

Input Format

The first line contains an integer $n$. Each of the next $n$ lines describes a triangle with three integers $x_i, y_i, m_i$.

Output Format

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

Explanation/Hint

Sample explanation: ![](https://cdn.luogu.com.cn/upload/image_hosting/5ti25vl7.png) Constraints: $1 \le n \le 2000$, $1 \le i \le n$, $-10^7 \le x_i, y_i \le 10^7$, $1 \leq m_i \le 1000$. Translated by ChatGPT 5