시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 8 2 2 50.000%

문제

평면상에 n개의 직각이등변삼각형들이 있을 때, 이 삼각형들이 덮는 면적을 구하는 프로그램을 작성하시오.

직각이등변삼각형은 세 정수 x, y, m(m>0)으로 표현된다. 이는 삼각형의 세 꼭지점이 (x, y), (x+m, y), (x, y+m)임을 의미한다.

입력

첫째 줄에 정수 n(1≤n≤2,000)이 주어진다. 다음 n개의 줄에는 각 삼각형을 나타내는 x, y, m이 주어진다. x, y는 절대값이 10,000,000을 넘지 않으며, m은 1,000이하이다.

출력

첫째 줄에 면적을 출력한다. 면적을 출력할 때는 소숫점 아래 한 자리를 반드시 출력한다.

예제 입력 1

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

예제 출력 1

24.5

힌트

W3sicHJvYmxlbV9pZCI6IjIyOTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM5YzFcdWFjMDEgXHVjNzc0XHViNGYxXHViY2MwIFx1YzBiY1x1YWMwMVx1ZDYxNSIsImRlc2NyaXB0aW9uIjoiPHA+XHVkM2M5XHViYTc0XHVjMGMxXHVjNWQwIG5cdWFjMWNcdWM3NTggXHVjOWMxXHVhYzAxXHVjNzc0XHViNGYxXHViY2MwXHVjMGJjXHVhYzAxXHVkNjE1XHViNGU0XHVjNzc0IFx1Yzc4OFx1Yzc0NCBcdWI1NGMsIFx1Yzc3NCBcdWMwYmNcdWFjMDFcdWQ2MTVcdWI0ZTRcdWM3NzQgXHViMzZlXHViMjk0IFx1YmE3NFx1YzgwMVx1Yzc0NCBcdWFkNmNcdWQ1NThcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC48XC9wPlxyXG48cD5cdWM5YzFcdWFjMDFcdWM3NzRcdWI0ZjFcdWJjYzBcdWMwYmNcdWFjMDFcdWQ2MTVcdWM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