Contracting Convex Hull
题号:NC223727
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Yukikaze has a contracting convex hull formed by the intersection of several moving halfplanes. We use directed lines to describe these halfplanes. For a directed line , we define the left side as the inner side, and the area to the left side of the line is the halfplane described by the line . Each halfplane moves  unit per second, and the moving direction is perpendicular to the line and pointing to the inner side. Read the notes for better understanding.

Yukikaze wants to know the area of the intersection of the halfplanes at some given time points.

输入描述:

The first line of the input contains a single integer  ().

The -th of the next  lines contains two integers  and  (), denoting the -th vertex of the initial convex hull. The -th halfplane is described by a directed line pointing from  to . The points are given in counter-clockwise order. It's guaranteed that the given points form a convex hull, and any three points are not collinear.

The next line of the input contains a single integer  (), denoting the number of time points.

Each of the next  lines contains a single real number  (), denoting that Yukikaze wants to know the area of the intersection at  second after the contraction begins. Each real number in the input has at most three digits after the decimal point.

输出描述:

For each given time point, output the answer in a single line.

Your answer is considered correct if its absolute or relative error does not exceed .

Formally, let your answer be , and the jury's answer be . Your answer is accepted if and only if .

示例1

输入

复制
5
0 0
2 0
2 1
1 2
0 2
6
0
0.2
0.4
0.6
0.8
1

输出

复制
3.5000000000
2.1702943725
1.1468629150
0.4297056275
0.0360808101
0.0000000000

说明



In the sample input, the initial convex hull  is formed by halfplane  seconds after the start, the convex hull is contracted to , formed by halfplane .