Xor
의견: 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 |
3
1 1 2
7 1 6
5 3 424.05
5 5 99
5 5 99
5 5 99
5 5 99
5 5 994900.54
5 5 99
5 5 99
5 5 99
5 5 990.0평가 및 의견
Xor
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Xor