#0001A2

IsoTriangles

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.



InputThe first line of the standard 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, -10^7 <= xi <= 10^7, -10^7 <= yi <= 10^7, 0 < mi <= 1000).

OutputOn the first line of the standard output you should write the total area convered by triangles with an accuracy of 1 decimal place.



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




OUTPUT:24.5

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.