시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
8 초 (추가 시간 없음) 512 MB 0 0 0 0.000%

문제

Taro lives in a town with N shelters. The shape of the town is a convex polygon.

He’ll escape to the nearest shelter in case of emergency. Given the current location, the cost of escape is defined as the square of the distance to the nearest shelter. Because emergency occurs unpredictably, Taro can be at any point inside the town with the same probability. Calculate the expected cost of his escape.

입력

The first line contains two integers M and N (3 ≤ M ≤ 100, 1 ≤ N ≤ 100), which denote the number of vertices of the town and the number of shelters respectively.

The following M lines describe the coordinates of the vertices of the town in the conunter-clockwise order. The i-th line contains two integers xi and yi (−1000 ≤ xi, yi ≤ 1000), which indicate the coordinates of the i-th vertex. You may assume the polygon is always simple, that is, the edges do not touch or cross each other except for the end points.

Then the following N lines describe the coordinates of the shelters. The i-th line contains two integers xi and yi, which indicate the coordinates of the i-th shelter. You may assume that every shelter is strictly inside the town and any two shelters do not have same coordinates.

출력

Output the expected cost in a line. The answer with an absolute error of less than or equal to 10−4 is considered to be correct.

예제 입력 1

4 1
0 0
3 0
3 3
0 3
1 1

예제 출력 1

2.0000000000

예제 입력 2

5 2
2 0
2 2
0 2
-2 0
0 -2
0 0
1 1

예제 출력 2

1.0000000000

예제 입력 3

4 3
0 0
3 0
3 3
0 3
1 1
1 2
2 2

예제 출력 3

0.7500000000