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 C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
using namespace std;

typedef long double ld;
typedef long long ll;

const int Maxn = 55;

int n;
int X[Maxn], Y[Maxn];
ld res = 1e100l;

void getLine(int x1, int y1, int x2, int y2, int &A, int &B, int &C)
{
    A = y2 - y1;
    B = x1 - x2;
    C = A * x1 + B * y1;
}

ld getMax(ld x, ld y)
{
    ld res = 0;
    for (int i = 0; i < n; i++)
        res = max(res, sqrt(ld(x - X[i]) * (x - X[i]) + ld(y - Y[i]) * (y - Y[i])));
    return res;
}

ld Check2(int a, int b)
{
    return getMax((X[a] + X[b]) / 2.0l, (Y[a] + Y[b]) / 2.0l);
}

ld Check3(int a, int b, int c)
{
    int A1, B1, C1; getLine(X[a], Y[a], X[b], Y[b], A1, B1, C1);
    int A2, B2, C2; getLine(X[b], Y[b], X[c], Y[c], A2, B2, C2);
    swap(A1, B1); A1 = -A1;
    C1 = (X[a] + X[b]) / 2 * A1 + (Y[a] + Y[b]) / 2 * B1;
    swap(A2, B2); A2 = -A2;
    C2 = (X[b] + X[c]) / 2 * A2 + (Y[b] + Y[c]) / 2 * B2;
    ll det = ll(A1) * B2 - ll(A2) * B1;
    if (det == 0) return 1e100l;
    ld x = (ld(B2) * C1 - ld(B1) * C2) / ld(det);
    ld y = (ld(A1) * C2 - ld(A2) * C1) / ld(det);
    return getMax(x, y);
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d %d", &X[i], &Y[i]);
        X[i] *= 2; Y[i] *= 2;
    }
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++) {
            res = min(res, Check2(i, j));
            for (int k = j + 1; k < n; k++)
                res = min(res, Check3(i, j, k));
        }
    cout << fixed << setprecision(9) << res / 2 << endl;
    return 0;
}