Movatterモバイル変換


[0]ホーム

URL:


Logo

33219번 -Avant-garde스페셜 저지다국어

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

문제

A new style of painting has recently exploded in popularity. The artist will start with some famous artwork as the background, and proceeds to splash big blobs of paint on the canvas. You think this new art form is terrible. To prove a point, you want to estimate the area of the nice background picture that gets ruined, because it gets covered by the blobs.

The artist has splashed $n$ big blobs on the canvas, which are shaped like perfect circles. All the centres of the blobs lie on the $x$-axis, so each blob is defined by a radius and $x$-coordinate. The second sample input is visualized in Figure A.1.

Calculate the area of the background that is no longer visible, because of the blobs. Your answer is correct if its relative error is less than $10\%$. So your answer is correct if: $$0.9 \times A_\textrm{actual} \leq A_\textrm{your output} \leq 1.1 \times A_\textrm{actual} $$

입력

The input consists of:

  • One line containing a single integer $n$ ($1\leq n\leq 10$), the number of blobs.
  • $n$ lines follow, one for each blob, each containing two integers: $x$ ($|x| \leq 10$), the $x$-coordinate of the centre of the blob and $r$ ($1 \leq r \leq 10 $), the radius of the the blob.

출력

Output the area of the background that is covered by the blobs as a decimal number. Your answer should have a relative error of at most $10\%$.

제한

예제 입력 1

11 1

예제 출력 1

3.1415926583406

예제 입력 2

3-6 10 34 2

예제 출력 2

41.9925053413308

예제 입력 3

3-4 3-4 1-4 3

예제 출력 3

28.2743338897644

힌트

Figure A.1: Visualization of Sample Input 2. The covered area is roughly equal to 42.

출처

University > Delft University of Technology > Freshmen Programming Contest 2022 A번

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일:contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호


[8]ページ先頭

©2009-2025 Movatter.jp