아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Downsizing

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

요약
원 밖에 있는 볼록 다각형을 반지름 r인 원에 대한 반전으로 옮긴 뒤, 세포 안에 생기는 영역의 넓이를 구한다.
난이도

보통10점 중 4점

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

문제

Renowned nuclear physicist Adam Szmasczer has found a solution to global overpopulation and scarce resources: shrink everything! More precisely, he has found a way to teleport regions of space (both bounded and unbounded) to a bounded set of points inside a finite spherical cell. He explains his process as follows (from here on, we will work only in two dimensions for simplicity).

Assume a circular cell of radius rr is centered at a point OO. Let PP be any point not in the interior of the cell, and suppose the line OP‾\overline{OP} intersects the cell's boundary at the point BB. Then point PP is teleported to a point P′P' lying on this line, where length(OP‾)⋅length(OP′‾)=r2\text{length}(\overline{OP})\cdot\text{length}(\overline{OP'}) = r^2. (Points along the cell boundary are teleported to themselves.) Figure D.1 shows how a pentagonal "house" is teleported to the shaded area within the circle; sample points OO, PP, P′P', and BB are identified in the figure to illustrate the teleportation rule.

Figure D.1: Sample input 1, illustrating the downsizing process

Given a convex polygonal shape not containing any interior point of the cell, Adam would like to know the area of the corresponding teleported shape. Can you help?

입력

The first line of input contains three integers x_0x\_0, y_0y\_0, and rr, −104≤x_0,y_0,r≤104-10^4 \leq x\_0,y\_0,r \leq 10^4, specifying the center of the circular cell and its radius. (The entire circular cell lies within the specified bounds.) The second line of input contains a positive integer nn, 3≤n≤1003 \leq n \leq 100, followed by nn pairs of integers x_1x\_1, y_1y\_1, x_2x\_2, y_2y\_2, \ldots, x_nx\_n, y_ny\_n, −104≤x_i,y_i≤104-10^4 \leq x\_i, y\_i \leq 10^4, giving the vertices of a convex polygon with nn vertices in counterclockwise order.

출력

Output the area of the region of the cell corresponding to the rectangular region in the input. Your answer should be correct to a relative or absolute error of 10−610^{-6}.

예제1

  1. 예제 1

    입력
    3 3 5
    5 11 9 9 6 9 1 13 1 13 6
    
    예상 출력
    4.112904