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 long li;

typedef long double Real;
typedef complex<Real> Point;
typedef pair<Point, Point> Line;
typedef pair<Point, Real> Circle;
typedef vector<Point> Poly;

const Real eps = 1e-9;

inline bool near(const Point& p, const Point& q){return abs(p - q) < eps;}
inline Real dot(const Point& p, const Point& q){return p.real() * q.real() + p.imag() * q.imag();}
inline Real cross(const Point& p, const Point& q){return p.real() * q.imag() - p.imag() * q.real();}

// ccw_b : old version of ccw.
inline Real ccw_b(const Point& p, const Point& q, const Point& r) {return cross(q - p, r - p);}

/* ccw :
   CD  : counter direction
   CW  : clock wise
   OS  : on segment
   CCW : counter clock wise
   D   : direction
*/
enum LPposit { P_CD = -2, P_CW = -1, P_OS = 0, P_CCW = 1, P_D = 2};
LPposit ccw(const Point& p, const Point& q, const Point& r) {
    Real c = ccw_b(p, q, r);
    if (c < -eps) return P_CW;
    if (c >  eps) return P_CCW;
    if (dot(q - p, r - p) < -eps) return P_CD;
    if (dot(p - q, r - q) < -eps) return P_D;
    return P_OS;
}

inline Real Sabs(const Line& l) {return abs(l.first - l.second); }

inline Real LPdist(const Line& l, const Point& p) {return abs(ccw_b(l.first, l.second, p)) / Sabs(l); }
inline Real SPdist(Line l, Point p) {
    Real a = abs(l.first  - p);
    Real b = abs(l.second - p);
    Real c = Sabs(l);
    if (b * b + c * c > a * a && a * a + c * c > b * b){
        return LPdist(l, p);
    }
    return min(a, b);
}

bool crossS(const Line& p, const Line& q){
    return
            ccw(p.first, p.second, q.first) * ccw(p.first, p.second, q.second) <= 0 &&
            ccw(q.first, q.second, p.first) * ccw(q.first, q.second, p.second) <= 0;
}

Point intersect(const Line& p, const Line& q) {
    Point vp = p.second - p.first;
    Point vq = q.second - q.first;
    Point c(cross(vp, p.first), cross(vq, q.first));
    return Point(cross(c, Point(vp.real(), vq.real())), cross(c, Point(vp.imag(), vq.imag()))) / cross(vp, vq);
}

Line suinito(const Point& p, const Point& q) {
    Point r = (p + q) / (Point)2;
    return {r, r + (p - q) * Point(0, 1)};
    
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    li n;
    cin >> n;
    vector<Point> ps;
    for (int i = 0; i < n; ++i) {
        Real x, y;
        cin >> x >> y;
        ps.emplace_back(x, y);
    }

    auto check = [&](const Point& c, const Real& r) {
        bool ok = true;
        for (int l = 0; l < n; ++l) {
            ok &= abs(ps[l] - c) <= r + eps;
        }
        return ok;
    };

    Real ans = 1e300;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < i; ++j) {
            const Point c = (ps[i] + ps[j]) / (Real)2;
            const Real r = abs(ps[i] - c);
            if (check(c, r)) {
                ans = min(ans, r);
            }

            for (int k = 0; k < j; ++k) {
                const Point c = intersect(suinito(ps[i], ps[j]), suinito(ps[j], ps[k]));
                const Real r = abs(ps[i] - c);

                if (check(c, r)) {
                    ans = min(ans, r);
                }
            }
        }
    }
    cout.precision(12);
    cout << fixed << ans << endl;
    return 0;
}