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>
  
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
 
using namespace std;
 
#if !ONLINE_JUDGE
#define debug
#endif
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<pair<int,int> > vii;
typedef pair<ll,ll> pll;
typedef vector<vector<int> > vvi;
typedef vector<vector<ii> > vvii;
 
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define ff first
#define ss second
#define trav(a, x) for(auto& a : x) 
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)

#ifdef debug
#define dbg(...) { cerr<<"[ "; dump(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.ff<<","<<x.ss<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const unordered_map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
} 
 
template <typename Arg1>
void dump(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void dump(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    dump(names.substr(1+(int)name.size()), args...);
}
#else
    #define dbg(args...)
#endif
 
ll gcd(ll a,ll b){if (a==0) return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return a*(b/gcd(a,b));}
ll Abs(ll a){if(a>0)return a;return -a;}
ll Ceil(ll a,ll b){if(a%b==0)return a/b;else return a/b+1;}
double Abs(double a){if(a>0)return a;return -a;}
 
//*X.find_by_order(2) element at index=2
//X.order_of_key(1) how many elements strictly less than 1
 
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> 

const ll INF = 1e18;
const int mod = 1e9 + 7;
 
inline int pow_(ll x, ll y,ll p){
  int r = 1; while(y){if(y & 1) r = r * x % p; y >>= 1; x = x * x % p;} return r;
}
inline int inv_(int x){return pow_(x, mod - 2, mod);}
inline int add(ll a,ll b){a += b; if(a >= mod) a -= mod; return a;}
inline int mul(int a, int b){return a * 1LL * b % mod;}
inline int sub(int a, int b){a -= b; if(a < 0) a += mod; return a;}
  
mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
 
const int N = 1e5 + 5;

ll fact[N];


struct point{
    double x;
    double y;
};


double dist(double x1,double y1,double x2,double y2){

    return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}


point center_from(double bx, double by, double cx, double cy) {
    double B=bx*bx+by*by, C=cx*cx+cy*cy, D=bx*cy-by*cx;
    point X;
    X.x = (cy*B-by*C)/(2*D);
    X.y = (bx*C-cx*B)/(2*D);
    return X;
}


double EPS = 1e-12;

int main(int argc, char const *argv[])
{
    #ifdef LOCAL_TEST
    freopen("in.txt","r",stdin);
    //freopen("out.txt", "w", stdout);
    #else
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    #endif

    auto start = std::chrono::high_resolution_clock::now();

    int n;
    cin>>n;
    vector<ii> v;
    for(int i=1;i<=n;i++){
        int x,y;
        cin>>x>>y;
        v.pb({x,y});
    }

    double min = INF;

    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            double x = (v[i].ff + v[j].ff)/2.0;
            double y = (v[i].ss + v[j].ss)/2.0;
            double r = dist(v[i].ff,v[i].ss,x,y);
            int flag = 1;
            for(int k=0;k<n;k++){
                int x1 = v[k].ff;
                int y1 = v[k].ss;
                if(dist(x1,y1,x,y) > r + EPS){
                    flag = 0;
                }
            }

            if(flag){
                if(r < min)min = r;
            }
        }
    }


    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            for(int k=j+1;k<n;k++){
                point A;
                point B;
                point C;
                A.x = v[i].ff;
                A.y = v[i].ss;
                B.x = v[j].ff;
                B.y = v[j].ss;
                C.x = v[k].ff;
                C.y = v[k].ss;
                point D = center_from(B.x-A.x, B.y-A.y, C.x-A.x, C.y-A.y);
                double r = dist(A.x,A.y,D.x,D.y);
                int flag = 1;
                for(int k=0;k<n;k++){
                    int x1 = v[k].ff;
                    int y1 = v[k].ss;
                    if(dist(x1,y1,D.x,D.y) > r + EPS){
                        flag = 0;
                    }
                }

                if(flag){
                    if(r < min)min = r;
                }
            }
        }
    }

    printf("%0.15f\n", min);

    auto finish = std::chrono::high_resolution_clock::now();  
    std::chrono::duration<double> elapsed = finish - start;
    cerr << "Elapsed time: " << elapsed.count() << " s\n";
    
    return 0;    
}