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 <cstdio>

#include <cstring>

#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
//#include <queue>
//#include <stack>
#include <cassert>

#include <cmath>

using namespace std;

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

#define DEBUG(x) cerr << #x << ": " << x << endl

typedef long long llong;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename T>
struct Point {
   T x, y;
   Point(T _x = 0, T _y = 0) : x(_x), y(_y) {}
   Point(const Point<T>& p) : x(p.x), y(p.y) {}

   Point<T>& operator=( const Point<T>& p );
   bool operator==( const Point<T>& p ) const;
   bool operator!=(const Point<T>& p) const;
   bool operator<(const Point<T>& p) const;

   Point<T>& operator+=( Point<T> p );
   Point<T>  operator+ ( Point<T> p ) const;

   Point<T>& operator-=( Point<T> p );
   Point<T>  operator- ( Point<T> p ) const;

   Point<T>& operator*=( T a );
   Point<T>  operator* ( T a );

   T operator*( Point<T> p ) const;

   T operator^( Point<T> p ) const;

   T squared_mag() const;
   double mag() const;
};

template<typename T>
inline Point<T>& Point<T>::operator=( const Point<T>& p ) {
   if ( &p != this ) {
      x = p.x;
      y = p.y;
   }
   return *this;
}

template<typename T>
inline bool Point<T>::operator==(const Point<T>& p) const {
   return x == p.x && y == p.y;
}

template<typename T>
inline bool Point<T>::operator!=(const Point<T>& p) const {
   return !(*this == p);
// return x != p.x || y != p.y;
}

template<typename T>
inline bool Point<T>::operator<(const Point<T>& p) const {
   return x < p.x || x == p.x && y < p.y;
}

template<typename T>
inline Point<T>& Point<T>::operator+=( Point<T> p ) {
   x += p.x;
   y += p.y;
   return *this;
}

template<typename T>
inline Point<T>& Point<T>::operator*=( T a ) {
   x *= a;
   y *= a;
   return *this;
}
   
template<typename T>
inline Point<T> Point<T>::operator*( T a ) {
   Point<T> res( *this );
   return res *= a;
}


template<typename T>
inline Point<T> Point<T>::operator+( Point<T> p ) const {
   Point<T> res( *this );
   return res += p;
}

template<typename T>
inline Point<T>& Point<T>::operator-=( Point<T> p ) {
   x -= p.x;
   y -= p.y;
   return *this;
}

template<typename T>
inline Point<T> Point<T>::operator-( Point<T> p ) const {
   Point<T> res( *this );
   return res -= p;
}


template<typename T>
inline T Point<T>::operator*( Point<T> p ) const {
   return x*p.x + y*p.y;
}

template<typename T>
inline T Point<T>::operator^( Point<T> p ) const {
   return x*p.y - y*p.x;
}

template<typename T>
inline T Point<T>::squared_mag() const {
   return x*x + y*y;
}

template<typename T>
inline double Point<T>::mag() const {
   return sqrt( x*x + y*y );
}

// http://en.wikipedia.org/wiki/Circumscribed_circle#Cartesian_coordinates
Point<double> circum_center(
   Point<double> A, Point<double> B, Point<double> C,
   double &radius
) {
   Point<double> Bp = B - A;
   Point<double> Cp = C - A;
   double Dp = 2 * (Bp ^ Cp);
   Point<double> Up(
      ( Cp.y * Bp.squared_mag() - Bp.y * Cp.squared_mag() ) / Dp,
      ( Bp.x * Cp.squared_mag() - Cp.x * Bp.squared_mag() ) / Dp
   );
   radius = Up.mag();
   return Up + A;
}


#define MAXN 52
int N;
Point<double> P[MAXN];

double EPS = 1e-9;
double solve() {
   if (N == 1)
      return 0.0;

   if (N == 2)
      return (P[0]-P[1]).mag()/2;

   double res = 1e18;
   FOR(i, 0, N-1) {
      FOR(j, i+1, N-1) {
         FOR(k, j+1, N-1) {
            double r;
            Point<double> center = circum_center(P[i], P[j], P[k], r);
            double r2 = r*r;
            bool ok = true;
            REP(n, N) {
               if ((P[n]-center).squared_mag() > r2 + EPS) {
                  ok = false;
                  break;
               }
            }
            if (ok)
               res = min(res, r);
         }
      }
   }

   return res;
}

int main(int argc, char* argv[]) {
   scanf("%d", &N);
   assert(2 <= N && N <= 50);
   REP(i, N) {
      int x, y;
      scanf("%d %d", &x, &y);
      assert(0 <= x && x <= 1000);
      assert(0 <= y && y <= 1000);
      P[i].x = x;
      P[i].y = y;
   }

   double res = solve();
   printf("%.12f\n", res);

   return 0;
}