Watering Plants (Large)

No attempts yetTime limit60sMemory limit512 MB

Problem

Your greenhouse holds several plants that need water. Each plant takes up an area which is a circle, and no two plants overlap or touch.

You are going to buy two sprinklers. Each sprinkler sprays water on every point inside a circle of radius RR. One sprinkler runs in the morning and the other runs at night. A plant gets enough water only if its whole area is watered in the morning, or its whole area is watered at night. So the circle of each plant must lie completely inside at least one of the two circles the sprinklers water.

The sprinklers are installed on the ceiling, so a sprinkler's position may be inside the area of a plant.

Given the center and the radius of every plant, find the minimum radius RR for which the two sprinklers can be placed so that every plant gets enough water.

Input

The first line contains the number of test cases CC.

Each test case has the following form.

  • One line with the number of plants NN.
  • NN lines, one per plant, each with three integers X Y R, where (X,Y)(X, Y) is the center of the plant and RR is its radius.

Limits

  • Every number in the input is an integer.
  • 1X10001 \le X \le 1000
  • 1Y10001 \le Y \le 1000
  • 1R1001 \le R \le 100
  • 1C301 \le C \le 30
  • 1N401 \le N \le 40
  • No two plants overlap or touch.

Output

For each test case, print one line of the form Case #x: R, where xx is the number of the test case starting from 1 and RR is the minimum radius of the sprinklers. Print RR rounded to exactly four digits after the decimal point.

Every answer in the test data is at least 10510^{-5} away from a rounding boundary. A solution whose error is at most 10610^{-6} prints the same digits.

Notes

In the first test case of the sample, a sprinkler of radius at least 7 centered at (20,15)(20, 15) waters the first two plants, and a sprinkler of radius 3 waters the plant at (40,10)(40, 10).

In the second test case, one of the two sprinklers needs a radius of at least 8. The plant at (30,10)(30, 10) must also lie completely inside one of the two circles.