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: Wrong Answer)

#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    int N;
    cin >> N;
    long double ans = 1e8;
    vector<pair<long double, long double>> p(N);
    for (size_t i = 0; i < N; i++)
    {
        cin >> p[i].first >> p[i].second;
    }
    auto score = [&](long double x, long double y) {
        long double res = 0;
        for (size_t i = 0; i < N; i++)
        {
            chmax(res, sqrt((p[i].first - x) * (p[i].first - x) + (p[i].second - y) * (p[i].second - y)));
        }
        return res;
    };
    long double ansx = 0, ansy = 0;
    long double left = 0, right = 10;
    int num = 1e3;
    for (size_t i = 0; i < num; i++)
    {
        long double c1 = (left * 2 + right) / 3, c2 = (left + right * 2) / 3;
        long double l2 = 0, r2 = 1000;
        for (size_t i = 0; i < num; i++)
        {
            long double d1 = (l2 * 2 + r2) / 3, d2 = (l2 + r2 * 2) / 3;
            if (score(c1,d1 ) > score(c1,d2))
            {
                l2 = d1;
            }
            else
            {
                r2 = d2;
            }
        }
        long double ls = score(c1,l2);
        long double l3 = 0, r3 = 1000;
        for (size_t i = 0; i < num; i++)
        {
            long double d1 = (l3 * 2 + r3) / 3, d2 = (l3 + r3 * 2) / 3;
            if (score(c2,d1 ) > score(c2,d2))
            {
                l3 = d1;
            }
            else
            {
                r3 = d2;
            }
        }
        long double rs = score(c2,l3);
        chmin(ans,ls);
        chmin(ans,rs);
        if (ls > rs)
        {
            left = c1;
        }
        else
        {
            right = c2;
        }
    }
    

    cout << setprecision(10) << ans;
    return 0;
}