#K33462. Smallest Enclosing Circle

    ID: 25093 Type: Default 1000ms 256MiB

Smallest Enclosing Circle

Smallest Enclosing Circle

You are given a set of points in a 2D plane. Your task is to compute the smallest enclosing circle that contains all the points. The circle is defined by its center (x, y) and its radius r. Output the center coordinates and the radius with six decimal places.

Formally, given a set of points \(\{(x_i,y_i)\}_{i=1}^{n}\), find \( (x, y, r) \) such that for all \(i\): \[ \sqrt{(x_i - x)^2 + (y_i - y)^2} \le r \] and \(r\) is minimized.

inputFormat

The input consists of multiple test cases. Each test case begins with an integer n indicating the number of points. This is followed by n lines, each containing two numbers representing the coordinates of a point. A test case with n = 0 indicates the end of input.

Input is read from standard input.

outputFormat

For each test case, output one line with three numbers: the x-coordinate of the center, the y-coordinate of the center, and the radius of the smallest enclosing circle, each formatted to six decimal places. Print the results to standard output.

## sample
3
0 0
1 0
0 1
0
0.500000 0.500000 0.707107

</p>