Problem:
Score : 600 points

Problem Statement

Given are N points (x_i, y_i) in a two-dimensional plane.

Find the minimum radius of a circle such that all the points are inside or on it.

Constraints

2 \leq N \leq 50

0 \leq x_i \leq 1000

0 \leq y_i \leq 1000

The given N points are all different.

The values in input are all integers.

Input

Input is given from Standard Input in the following format:

N
x_1 y_1
:
x_N y_N

Output

Print the minimum radius of a circle such that all the N points are inside or on it.

Your output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.

Sample Input 1

2
0 0
1 0

Sample Output 1

0.500000000000000000

Both points are contained in the circle centered at (0.5,0) with a radius of 0.5.

Sample Input 2

3
0 0
0 1
1 0

Sample Output 2

0.707106781186497524

Sample Input 3

10
10 9
5 9
2 0
0 0
2 7
3 3
2 5
10 0
3 7
1 9

Sample Output 3

6.726812023536805158

If the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.

Solution in Python (3.4.3) (judge verdict: Accepted)

import numpy as np
import sys, math

def circle3p(ps):
    A = []
    B = []
    for x, y in ps:
        # eq = sp.Eq(x * a + y * b + c, - x * x - y * y)
        Ai = [x, y, 1]
        A.append(Ai)
        B.append(- x * x - y * y)
    try:
        x = np.linalg.solve(A, B)
        return x[0], x[1], x[2]
    except np.linalg.LinAlgError:
        return None

def circle2p(ps):
    xy0, xy1 = ps
    return [(xy0[0] + xy1[0]) / 2., (xy0[1] + xy1[1]) / 2., ((xy0[0] - xy1[0]) ** 2 + (xy0[1] - xy1[1]) ** 2) / 4.]

eps = 1e-7

def main():
    N = int(sys.stdin.readline())
    ps = []
    for i in range(N):
        x, y = map(int, sys.stdin.readline().split())
        ps.append((x, y))

    n = len(ps)
    ok = False
    res = int(1e9)

    if n == 2:
        x0, y0 = ps[0]
        x1, y1 = ps[1]
        print('%.9f' % (math.sqrt((x0 - x1) ** 2 + (y0 - y1) ** 2) / 2.))
        return

    for i in range(n):
        for j in range(i + 1, n):
            for k in range(j + 1, n):
                circle = circle3p([ps[i], ps[j], ps[k]])
                if circle is None:
                    continue
                a, b, c = circle
                for l in range(n):
                    if l in {i, j, k}:
                        continue
                    x, y = ps[l]
                    if x * x + y * y + a * x + b * y + c > eps:
                        break
                else:
                    res = min(res, a * a / 4 + b * b / 4 - c)

    for i in range(n):
        for j in range(i + 1, n):
            circle = circle2p([ps[i], ps[j]])
            if circle is None:
                continue
            a, b, c = circle
            for l in range(n):
                if l in {i, j}:
                    continue
                x, y = ps[l]
                if (x - a) ** 2 + (y - b) ** 2 > c + eps:
                    break
            else:
                res = min(res, c)

    print('%.9f' % float(math.sqrt(float(res))))


if __name__ == '__main__':
    main()