KUPUS | 프로그래밍의 벗 PivotOJ
PivotOJ

KUPUS

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2008 National Competition #1 - JuniorsBOJ 3123

문제

Mirko has decided to grow cabbage on the roof of his building. To water the cabbage he will place N identical sprinklers, each watering a circular region with radius 1. 

The roof of the building is rectangular, X units long and Y units wide, so it can be modeled by a rectangle in the coordinate plane with sides parallel to the axes and corners in points (0, 0) and (X, Y). Because the pipes are laid out in a perfect grid, all sprinklers are located in points with integer coordinates. 

Write a program that, given the coordinates of all sprinklers, determines the total area of the roof covered by the sprinklers. 

입력

The first line contains two integers X and Y (1 ≤ X ≤ 1000, 1 ≤ Y ≤ 1000), the dimensions of Mirko's roof. 

The second line contains the integer N (1 ≤ N ≤ 10 000), the number of sprinklers. 

Each of the following N lines contains the coordinates of one sprinkler; two integers x and y, (0 ≤ x ≤ X, 0 ≤ y ≤ Y). 

출력

Output a real number in decimal notation, the overall area of the roof covered by sprinklers, in square units. Your output must be accurate to ±0.001.

예제

예제 1

입력
4 5
2
0 0
4 4
출력
2.356194

예제 2

입력
10 3
2
5 1
6 1
출력
5.054816

예제 3

입력
7 7
4
3 2
2 2
1 1
6 3
출력
10.767205
코드를 제출하려면 로그인하세요.