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>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
} 

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    vector <pair<int,int> > v(n);
    for(int i=0;i<n;i++)
    {
        int x=nxt(),y=nxt();
        v[i]={x,y};
    }
    int count=0;
    double l=0,r=2000;
    double ans=2000;
    while(l<=r&&count<50)
    {
        count++;
        double R=(l+r)/2;
        bool t=0;
        for(int i=0;i<n;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                double x1=v[i].first,y1=v[i].second,x2=v[j].first,y2=v[j].second;
                double x3=(x1+x2)/2,y3=(y1+y2)/2,x4=(x1+x2)/2,y4=(y1+y2)/2;
                double dist=sqrt(pow((y2-y1),2)+pow(x2-x1,2));
                if(dist>2*R)
                    continue;
                double h=sqrt(R*R-(dist/2)*(dist/2));
                bool flag=1;
                if(y1-y2==0)
                {
                    y3+=h;
                    y4-=h;
                }
                else
                {
                    double x=1,y=-(x2-x1)/(y2-y1);
                    double val=sqrt(x*x+y*y);
                    x/=val;y/=val;
                    x*=h;y*=h;
                    x3+=x;y3+=y;
                    x4-=x;y4-=y;
                }
                for(int k=0;k<n;k++)
                {
                    if(k!=i&&k!=j)
                    {
                        if(sqrt(pow(v[k].first-x3,2)+pow(v[k].second-y3,2))>R)
                        {
                            flag=0;
                            break;
                        }
                    }
                }
                if(flag)
                {
                    t=1;
                    break;
                }
                flag=1;
                for(int k=0;k<n;k++)
                {
                    if(k!=i&&k!=j)
                    {
                        if(sqrt(pow(v[k].first-x4,2)+pow(v[k].second-y4,2))>R)
                        {
                            flag=0;
                            break;
                        }
                    }
                }
                if(flag)
                {
                    t=1;
                    break;
                }

            }
            if(t)
                break;
        }
        if(t)
        {//cout<<R<<": 1\n";
            if(R<ans)
                ans=R;
            r=R;
        }
        else{
            l=R;
            //cout<<R<<endl;
        }
    }

    cout<<setprecision(16)<<ans<<endl;
  

    return 0;   
}