light
题号:NC239338
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

The campus is surrounded by a convex polygon fence with thickness and equal height, (the fence is impervious to light and has no holes). With moonlight shining, ask how much area on the ground in the campus is illuminated by moonlight.

The top view of the fence is shown below, it can be considered as the edge of the inner circle is obtained by translating the edge of the outer circle inward by an equal distance.

Note that we regard the moonlight here as a point light source, and the coordinate information will be given in the input.


输入描述:

The input consists of multiple test cases.

The first line contains an integerT() -- the number of test cases.

For each test case:

The first line contains two positive integers n,h(), indicating the number of outer prisms of the fence (number of points in the top view), and the height of the fence.

The second line, a number w(, with at most  decimal places), indicates the thickness of the fence.

In the next n lines, each line contains two integers x_i,y_i (), indicating the coordinates of the projection of a prism on the ground, ensuring that these points are given counterclockwise in the top view.

The last line contains three integers x,y,z(), denoting the coordinates of the light source: a light source with height z at (x,y).

It is guaranteed that the sum of  over all test cases doesn't exceed .

输出描述:

For each test, output a number in a line indicates the answer.

If the light is strictly inside the wall, the answer is 0.

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

Formally, let your answer be a, and the jury's answer be b. Your answer is accepted if and only if .
示例1

输入

复制
3
4 1
0.5
0 0
2 0
2 2
0 2
2 0 5
4 2
0.5
0 0
2 0
2 2
0 2
3 0 1
4 2
0.5
0 0
2 0
2 2
0 2
1 1 1

输出

复制
0.7656250000
0.0000000000
1.0000000000