Avant-garde

시간 제한1초메모리 제한2048 MB

요약
x축 위에 중심이 있는 최대 10개의 원이 덮는 넓이를 10% 오차로 계산한다.
난이도

보통10점 중 4점

유형
기하, 수학, 완전 탐색
정답자
아직 제출이 없습니다

문제

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 nn big blobs on the canvas, which are shaped like perfect circles. All the centres of the blobs lie on the xx-axis, so each blob is defined by a radius and xx-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 1010\\%. So your answer is correct if: 0.9×A_actual≤A_your output≤1.1×A_actual0.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 nn (1≤n≤101\leq n\leq 10), the number of blobs.
  • nn lines follow, one for each blob, each containing two integers: xx (∣x∣≤10|x| \leq 10), the xx-coordinate of the centre of the blob and rr (1≤r≤101 \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 1010\\%.

힌트

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

예제3

  1. 예제 1

    입력
    1
    1 1
    
    예상 출력
    3.1415926583406
    
  2. 예제 2

    입력
    3
    -6 1
    0 3
    4 2
    
    예상 출력
    41.9925053413308
    
  3. 예제 3

    입력
    3
    -4 3
    -4 1
    -4 3
    
    예상 출력
    28.2743338897644