시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 102 45 33 47.143%

문제

상근이는 건물 옥상에서 배추를 재배하기로 했다. 매번 물을 주러 옥상에 올라가기 귀찮기 때문에, N개의 스프링쿨러를 설치하려고 한다.

스프링쿨러는 모두 같은 모델이며, 그 스프링쿨러를 중심으로 하는 반지름이 1인 원에 물을 뿌릴 수 있다.

빌딩의 옥상은 가로 X, 세로 Y인 직사각형이다. 옥상은 축에 평행한 직사각형으로 모델링 할 수 있으며, 양 꼭지점의 좌표는 (0, 0)과 (X, Y) 가 된다.

스프링쿨러는 정수 좌표를 갖는 곳에만 설치할 수 있다.

빌딩의 크기와 스프링쿨러의 위치가 주어졌을 때, 물을 뿌릴 수 있는 영역의 넓이를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 X와 Y가 주어진다. (1 ≤ X, Y ≤ 1000)

둘째 줄에 스프링쿨러의 수 N이 주어진다. (1 ≤ N ≤ 10,000)

셋째 줄부터 N개 줄에는 스프링 쿨러의 좌표 x와 y가 주어진다. (0 ≤ x ≤ X, 0 ≤ y ≤ Y)

출력

스프링쿨러가 물을 뿌릴 수 있는 영역의 넓이를 출력한다. 오차는 ±0.01까지 허용한다.

예제 입력 1

10 3
2
5 1
6 1

예제 출력 1

5.054816

힌트

\(P=2\cdot \frac { 1^{ 2 }\cdot \pi  }{ 360 ^{\circ}  } \cdot 240^{\circ} + 2 \cdot \frac {1^{2} \cdot \sqrt { 3 }} {4} = 2 \cdot \frac {2} {3} \cdot \pi + 2 \cdot \frac {\sqrt{3}}{4} \)

W3sicHJvYmxlbV9pZCI6IjMxMjMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMzBcdWNkOTQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzBjMVx1YWRmY1x1Yzc3NFx1YjI5NCBcdWFjNzRcdWJiM2MgXHVjNjI1XHVjMGMxXHVjNWQwXHVjMTFjIFx1YmMzMFx1Y2Q5NFx1Yj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