Diện tích các tam giác vuông cân

View as PDF

Submit solution

Points: 0.74 (partial)
Time limit: 0.38s
Memory limit: 512M
Input: stdin
Output: stdout

Problem source:
BOI 2002
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Cho ~N~ tam giác vuông cân. Hãy tính diện tích miền bị phủ bởi ~N~ tam giác này.

Input

Dòng ~1~: số nguyên ~N~ (~1 \leq N \leq 2000~).

~N~ dòng tiếp theo, mỗi dòng gồm ~3~ số nguyên ~x_{i}~, ~y_{i}~, ~m_{i}~ (- ~10^{7} \leq~ ~x_{i}~, ~y_{i}~ ~\leq 10^{7}~, ~1 \leq~ ~m_{i}~ ~\leq 1000~) mô tả toạ độ tam giác thứ ~i~, ~3~ đỉnh tam giác ~i~ sẽ có toạ độ (~x_{i}~, ~y_{i}~), (~x_{i}~+~m_{i}~, ~y_{i}~), (~x_{i}~, ~y_{i}~+~m_{i}~).

Output

Gồm ~1~ dòng duy nhất ghi ra diện tích miền bị phủ. Ghi ra với đúng 1 chữ số sau phần thập phân.

Sample Input

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

Sample Output

24.5

Note

image


Comments

Please read the guidelines before commenting.


There are no comments at the moment.