Aircraft war
题号:NC214841
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Recently, Poor Kujo was playing a game. There are n enemies on the plane, and the coordinates of each enemy are xi,yix_i,y_ixi,yi. Poorly one skill is to draw a simple polygon with m points on the plane and destroy all enemies strictly inside the polygon.

It is not difficult to find that if you want to quickly destroy the enemy, you only need to draw a simple polygon that is large enough. But this kind of gameplay is too bad. So poor planned to add some randomness to the game.

Poor Kujo drew a simple polygon (ai,bi) with m points on the plane. Next, Poor Kujo intends to randomly select the number α\alphaα (which can be understood as equal probability selection) according to the uniform distribution on [-π,π), and wrap this simple polygon The origin is rotated counterclockwise by the angle of α (in radians).

Now Poor Kujo gives you the coordinates of each point, the coordinates of the polygon, and your task is to help Poor calculate how many enemies she expects to destroy after random rotation.

输入描述:

Two integers n, m in the first line

In the next n lines, two integers xi and yi in each line describe the coordinates of an enemy.

In the next m lines, each line of two integers ai, bi describes each vertex of the simple polygon in counterclockwise order.

输出描述:

Output an integer on a line to represent the expected value, with five decimal places. And no rounding
示例1

输入

复制
4 4
0 0
1 0
-1 -1
0 1
0 0
1 0
1 1
0 1

输出

复制
0.50000