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

题目描述

See Problem N for PDF statements.
Welcome To My Religion.



Internet Angel descends! She is aimed at saving us, humans. The people waiting to be redeemed are enclosed in what can be seen as a convex polygon of n vertices on a 2D plane. This convex polygon is somehow special: there exists a circle with its center at (0,0) that is tangent to every side of the polygon. We denote the circle by .

Angle Chan does not descend directly into the crowd but additionally draws a large circle with the center at (0,0) that can surround the whole crowd. We denote the circle by . Next, she will choose a location between the circle and the crowd uniformly randomly, and then for all the tangent points of each side of the polygon, she will choose a point nearest to her and follow the shortest path to the crowd.

For convenience, when inputting this convex polygon we input and n angles indicating the position of the tangent point of each side of the polygon on . You can check the input format and the sample to get a better understanding.

Now, Angle Chan wants to know what is the expectation of the squared distance of this shortest path.

输入描述:

The first line contains an integer , denoting that there are T test cases.

For each test case, the first line contains three integers n, R_1, R_2 (, ), indicating the number of points of the convex polygon, the radius of and respectively.

The next line contains n integers (), indicating that the tangent point of the i-th side lies at .

It is guaranteed that all the tangent lines can form a convex polygon, and all points inside or on the sides of the convex polygon are strictly inside .

输出描述:

For each test case, print the expected squared distance in a line. Your answer will be considered correct if the absolute or relative error between yours and the standard answer is no more than .
示例1

输入

复制
1
4 2 4
-10000 -5000 0 5000

输出

复制
2.893122167156

说明

The figure of the example:


where D,E,F,G are the tangent points given in the input respectively.