시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB120493742.045%

문제

상근이는 건물 옥상에서 배추를 재배하기로 했다. 매번 물을 주러 옥상에 올라가기 귀찮기 때문에, 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

4 5
2
0 0
4 4

예제 출력 1

2.356194

예제 입력 2

10 3
2
5 1
6 1

예제 출력 2

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} \]

예제 입력 3

7 7
4
3 2
2 2
1 1
6 3

예제 출력 3

10.767205
W3sicHJvYmxlbV9pZCI6IjMxMjMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjMzBcdWNkOTQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzBjMVx1YWRmY1x1Yzc3NFx1YjI5NCBcdWFjNzR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