RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00142

Xor

Gold III 골드 III
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Mirko and Slavko have built their own LED display. The display is initially white. During each of the \(N\) parts of the testing phase, Mirko attached three electrodes to the display in such way that they formed a right isosceles triangle. He noticed that, after attaching the electrodes, all pixels in the enclosing triangle are inverted (white pixels become black, and black pixels become white).

Watching Mirko play with the electrodes, Slavko observed interesting shapes emerging on the screen. Mathematically inclined as he is, the first thing that crossed his mind was how to calculate the total area covered by black pixels. Help him by writing a program to do just that!

Each triangle has its right angle at the lower left corner, with the two equal sides going right (along the positive \(x\) axis) and up (along the positive \(y\) axis), and the hypotenuse joining their ends.

제약
입력 형식

The first line of input contains an integer \(N\) (\(1 \le N \le 10\)), number of triangles formed by Mirko's fiddling with electrodes. Each of the following \(N\) lines contains three integers \(X\), \(Y\) and \(R\) (\(1 \le X, Y, R \le 10^6\)), describing a triangle. \((X, Y)\) are the coordinates of the lower left corner of the triangle, while \(R\) represents the length of the two sides of the triangle.

출력 형식

The first and only line of output should contain the area covered by black
pixels, rounded to one decimal place.
SAMPLE TEST CASES
Input:
3
1 1 2
7 1 6
5 3 4
Input:
5
5 5 99
5 5 99
5 5 99
5 5 99
5 5 99
Input:
4
5 5 99
5 5 99
5 5 99
5 5 99
Output:
24.0
Output:
4900.5
Output:
0.0

서브태스크
서브태스크점수설명

Test 1

10점

None

Test 2

10점

None

Test 3

10점

None

Test 4

10점

None

Test 5

10점

None

Test 6

10점

None

Test 7

10점

None

Test 8

10점

None

Test 9

10점

None

Test 10

10점

None

예제 1
입력
3
1 1 2
7 1 6
5 3 4
출력
24.0
예제 2
입력
5
5 5 99
5 5 99
5 5 99
5 5 99
5 5 99
출력
4900.5
예제 3
입력
4
5 5 99
5 5 99
5 5 99
5 5 99
출력
0.0
문제 정보

riseoj 작성

출처 COCI 2009/2010 Contest 6

평가 및 의견

Xor

개요
출제자 난이도 Gold III 골드 III 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Xor

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8