Monitored Area
题号:NC238084
时间限制:C/C++/Rust/Pascal 9秒,其他语言18秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Curator George owns a gallery full of valuable artworks. To monitor and protect the artworks in this
gallery, there are many CCTV cameras installed.
The gallery can be viewed as a simple polygon. And the cameras can be viewed as points inside the
polygon.
We say that one point in the gallery is monitored if there exists a camera such that the segment between
the camera and the point is inside the gallery.
Now George asks for your help to calculate the area of the monitored points.

输入描述:

The first line contains an integer  — the number of vertices of the polygon.
Then n lines follow. The i-th line contains two integer — the coordinates of the i-th
polygon vertex. The vertices are given in clockwise order, and no three consecutive vertices are collinear.
The next line contains an integer — the number of cameras.
Then m lines follow. The i-th line contains two integer — the coordinate of the i-th
camera.
It is guaranteed that the cameras are strictly inside the gallery.

输出描述:

Output the area of the monitored points. Your answer should have an absolute or relative error less
than
. Namely, if your answer is a and the jury’s answer is b, then your answer is accepted if
.
示例1

输入

复制
8
0 0
0 5
5 5
5 10
10 10
10 5
50 5
50 0
1
8 7

输出

复制
79.166666667