시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB200796750.000%

문제

동혁이는 스케치북에 직각 이등변 삼각형 N개를 그리려고 한다. 동혁이가 가지고 있는 크레파스는 흰색과 검정색이다.

동혁이가 삼각형을 그릴때마다, 삼각형 내부의 색을 모두 반전시킨다. 즉, 흰색은 검정색으로, 검정색은 흰색으로 칠한다.

이때, 검정색의 면적을 구하는 프로그램을 작성하시오. 가장 처음에 스케치북은 흰색으로 칠해져 있다.

입력

첫째 줄에 삼각형의 개수 N(1 ≤ N ≤ 10)이 주어진다. 다음 N개의 줄에는 직각 이등변 삼각형의 정보 X, Y, R(1 ≤ X, Y, R ≤ 106)이 주어진다. (X,Y)는 삼각형의 왼쪽 아래 꼭짓점의 좌표이고, R는 삼각형 두 변의 길이이다.

출력

첫째 줄에, 검정색으로 칠해진 영역의 면적을 소수점 첫째자리까지 출력한다.

예제 입력 1

3
1 1 2
7 1 6
5 3 4

예제 출력 1

24.0

예제 입력 2

5
5 5 99
5 5 99
5 5 99
5 5 99
5 5 99

예제 출력 2

4900.5

예제 입력 3

4
5 5 99
5 5 99
5 5 99
5 5 99

예제 출력 3

0.0
W3sicHJvYmxlbV9pZCI6IjI4OTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJYT1IgXHViM2M0XHVkNjE1IiwiZGVzY3JpcHRpb24iOiI8cD5cdWIzZDlcdWQ2MDFcdWM3NzRcdWIyOTQgXHVjMmE0XHVjZjAwXHVjZTU4XHViZDgxXHVjNWQwIFx1YzljMVx1YWMwMSBcdWM3NzRcdWI0ZjFcdWJjYzAgXHVjMGJjXHVhYzAxXHVkNjE1IE5cdWFjMWNcdWI5N2MgXHVhZGY4XHViOWFjXHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC4gXHViM2Q5XHVkNjAxXHVjNzc0XHVhYzAwIFx1YWMwMFx1YzljMFx1YWNlMCBcdWM3ODhcdWIyOTQgXHVkMDZjXHViODA4XHVkMzBjXHVjMmE0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