1473. Triangles

单点时限: 2.0 sec

内存限制: 256 MB

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.

输入格式

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 input 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).

输出格式

On the first line one number with exactly one digit after decimal point must be written – the total area covered by triangles.

样例

Input
5
-5 -3 6
-1 -2 3
0 0 2
-2 2 1
-4 -1 2
Output
24.5
Hint:

0 人解决,2 人已尝试。

0 份提交通过,共有 4 份提交。

9.9 EMB 奖励。

创建: 17 年,3 月前.

修改: 7 年,2 月前.

最后提交: 1 年,4 月前.

来源: BOI 2002

题目标签