Antenna Repair (Small)

Arrange the K rods around a shared point with equal spacing to maximize the sum of adjacent triangle areas.

Medium4Brute forceGeometryMathNo attempts yetTime limit5sMemory limit512 MB

Problem

The explorer Pascal found a device that an ancient civilization left behind for talking to aliens, and he worked out how to use it. The antenna of the device is built from KK elements. An element is a straight rod made of a special material. One end of an element is its plus pole, the other end is its minus pole. The elements are numbered from 1 to KK.

The antenna works only when it is assembled so that all four conditions below hold.

  • Every element lies in one plane.
  • The plus poles of all elements meet at a single point. That point is the junction.
  • The only place where two elements meet is the junction.
  • Every pair of neighboring elements forms an angle of 360/K360/K degrees.

The angles add up to exactly one full turn, so the elements sit around the junction in a ring and there are exactly KK pairs of neighboring elements. Take one such pair: the two minus poles and the junction form a triangle. The strength of the antenna is the sum of the areas of those KK triangles.

Compute the largest strength that an arrangement of the elements reaches.

An element is thin enough that its thickness is ignored. You cannot cut an element, and you cannot join several elements into one.

Input

The first line has a positive integer TT, the number of test cases. Each test case has this format.

K
E1 E2 ... EK

KK is the number of elements. EiE_i is a positive integer, the length of element ii.

Constraints

  • 1T1001 \le T \le 100
  • 3K53 \le K \le 5
  • 1Ei10001 \le E_i \le 1000

Output

For each test case print one line in this format.

Case #X: P

XX is the test case number starting from 1, and PP is the largest strength. Print PP rounded to six digits after the decimal point, padded with zeros. A strength of 2 is written 2.000000.