Radar Coverage
Time limit1sMemory limit256 MB
Find the center of the smallest circle enclosing three given points for each test case.
- Level
Medium4 of 10
- Topics
- Geometry
- Solved
- No attempts yet
Problem
The army wants to install a new radar that watches three important locations on a map. The X and Y coordinates of the three locations are given. The radar goes where its power can stay as low as possible while all three locations are still watched. Lowering the power shrinks the circular area the radar covers, so the radar sits at the center of the smallest circle that contains all three locations. That circle is unique.
Find the X and Y coordinates of the spot where the radar is installed.
Input
The input holds several test cases. The first line contains the number of test cases ().
Each of the next lines contains six integers, the coordinates of the three important locations. Read them two at a time: the X and Y coordinates of the first location, then of the second, then of the third. Every coordinate satisfies and . The three locations may lie on one straight line, and two or three of them may coincide.
Output
For each test case print one line in the form Case #n: X Y, where is the test case number and X and Y are the coordinates of the radar.
Write each coordinate with two decimal places. When a value falls exactly halfway between two numbers with two decimal places, round it up.