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 <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring> //memset(dp,0,sizeof(dp))
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define repp(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j]
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく

int main(){
    int n; cin >> n;
    double x[n],y[n];
    rep(i,n) cin >> x[i] >> y[i];
    double ans=800.0000000;
    if(n==2){
        ans=(sqrt((x[0]-x[1])*(x[0]-x[1])+(y[0]-y[1])*(y[0]-y[1])))/2;
        cout << fixed << setprecision(10) << ans << endl;
        return 0;
    }
    rep(i,n){
        rep(j,n){
            if(i==j) continue;
            double cx=(x[i]+x[j])/2;
            double cy=(y[i]+y[j])/2;
            double r=sqrt((x[i]-cx)*(x[i]-cx)+(y[i]-cy)*(y[i]-cy));
            bool ok=1;
            rep(k,n){
                if(k==i||k==j) continue;
                if(r<sqrt((x[k]-cx)*(x[k]-cx)+(y[k]-cy)*(y[k]-cy))) ok=0;
            }
            if(ok) ans=min(ans,r);
        }
    }
    rep(i,n){
        rep(j,n){
            if(i==j) continue;
            rep(k,n){
                if(k==i||k==j) continue;
                //i,j,kを通る円
                double a=x[j]-x[i],b=y[j]-y[i],d=x[i]*x[i]-x[j]*x[j]+y[i]*y[i]-y[j]*y[j];
                double e=x[k]-x[j],f=y[k]-y[j],g=x[j]*x[j]-x[k]*x[k]+y[j]*y[j]-y[k]*y[k];
                if(a*f-e*b==0 || b*e-f*a==0) continue;
                double cx=(b*g-f*d)/(2*(a*f-e*b));
                double cy=(a*g-d*e)/(2*(b*e-f*a));
                double r=sqrt((x[i]-cx)*(x[i]-cx)+(y[i]-cy)*(y[i]-cy));
                bool ok=1;
                rep(l,n){
                    if(l==i||l==j||l==k) continue;
                    if(r<sqrt((x[l]-cx)*(x[l]-cx)+(y[l]-cy)*(y[l]-cy))) ok=0;
                }
                if(ok) ans=min(ans,r);
            }
        }
    }
    cout << fixed << setprecision(10) << ans << endl;
}