#P4033. Regular Polygon

    ID: 2910 远端评测题 1000ms 65MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>The 36th ACM/ICPC Asia Regional Chengdu Site —— Online Contest

Regular Polygon

Problem Description

In a 2_D plane, there is a point strictly in a regular polygon with N sides. If you are given the distances between it and N vertexes of the regular polygon, can you calculate the length of reguler polygon's side? The distance is defined as dist(A, B) = sqrt( (Ax-Bx)*(Ax-Bx) + (Ay-By)*(Ay-By) ). And the distances are given counterclockwise.

Input

First a integer T (T≤ 50), indicates the number of test cases. Every test case begins with a integer N (3 ≤ N ≤ 100), which is the number of regular polygon's sides. In the second line are N float numbers, indicate the distance between the point and N vertexes of the regular polygon. All the distances are between (0, 10000), not inclusive.

Output

For the ith case, output one line “Case k: ” at first. Then for every test case, if there is such a regular polygon exist, output the side's length rounded to three digits after the decimal point, otherwise output “impossible”.

2 3 3.0 4.0 5.0 3 1.0 2.0 3.0
Case 1: 6.766 Case 2: impossible