spoj#BOI02TRI. Triangles
Triangles
There are given n isosceles right triangles on a plane. Each triangle can be described by three integers x,y,m (m>0). Vertices of such a triangle are points which have coordinates (x;y), (x+m;y) and (x; y+m).
Write a program which calculates the total area covered by triangles.
Input
The first line of the input contains one positive integer n (n <= 2000), the number of triangles on a plane.
The next n lines of the file describe the triangles, one triangle per line. Each line contains three integers xi, yi and mi, separated by single spaces (1 <= i <= n, ‑107 <= xi <= 107, ‑107 <= yi <= 107, 0 < mi <= 1000).
Output
On the first line of the output one number with exactly one digit after decimal point must be written – the total area covered by triangles.
Example
Input 5 -5 -3 6 -1 -2 3 0 0 2 -2 2 1 -4 -1 2</p>Output 24.5