Town Square

Time limit1sMemory limit128 MB

Problem

Felix J. Humble, a wealthy resident of a small town, has erected four statues of himself in a public park that he owns. To keep the statues safe, he wants to build a square fence around them, and for aesthetic reasons the fence must satisfy all of the following conditions:

  1. The enclosed region is a square.
  2. Each statue is exactly 5 feet from its nearest side of the fence.
  3. No two statues have the same nearest side.

The square may be built at any orientation; its sides do not have to be parallel to the coordinate axes. Given the positions of the four statues, decide whether such a fence can be built and, if so, how long each side must be.

Input

The first line contains an integer $n$, the number of test cases.

Each of the next $n$ lines describes one test case with eight integers: the $x$ and $y$ coordinates of the first, second, third, and fourth statue, in that order. Every coordinate is measured in feet and satisfies $-100 \le v \le 100$. Within a test case, no two statues share the same location.

Output

For each test case, print a single line.

If a valid square fence exists, print Case k: L, where $k$ is the test case number (starting at 1) and $L$ is the side length of the largest valid square, rounded to the nearest hundredth of a foot and shown with exactly two digits after the decimal point.

If no valid square fence exists, print Case k: no solution.