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;
 
template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}
 
const double EPS = 1e-6;
using Point = complex<double>;
struct Line : public vector<Point> {
	Line(){}
	Line(const Point &a, const Point &b) {push_back(a); push_back(b);}
	Line(const double &a, const double &b, const double &c){
		if(abs(a)<EPS)insert(end(), {{0, -c/b}, {1,-c/b}});
		else if(abs(b)<EPS)insert(end(), {{-c/a, 0},{-c/a,1}});
		else insert(end(),{{-c/a, 0},{0, -c/b}});
	}
	Line(const double &a, const double &b){insert(end(), {{0, b}, {1, a+b}});};
};
double cross(const Point& a, const Point& b) {return imag(conj(a)*b);}
double dot(const Point& a, const Point& b) {return real(conj(a)*b);}
 
int ccw(Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > EPS)   return +1;       // counter clockwise
  if (cross(b, c) < -EPS)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}
 
Line ParpendicularBisectorLine(const Point &p, const Point &q){
	return Line(Point((p+q)*0.5), Point((p+q)*0.5+complex<double>(0.0, 1.0)*(q-p)));
}
 
Point crosspoint(const Line &l, const Line &m) {
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  if (abs(A) < EPS && abs(B) < EPS) return m[0];
  if (abs(A) < EPS) assert(false);
  return m[0] + B / A * (m[1] - m[0]);
}
 
class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		vector<Point> p(n);
		for(int i=0; i<n; i++){
			double x, y;
			cin >> x >> y;
			p[i] = Point(x, y);
		}
		if(n == 2){
			cout << setprecision(12) << abs(p[1]-p[0])*0.5 << endl;
			return;
		}
		double ans = numeric_limits<double>().max();
		for(int i=0; i < n; i++){
			double a = p[i].real();
			double b = p[i].imag();
			for(int j=i+1; j < n; j++){
				double c = p[j].real();
				double d = p[j].imag();
				for(int k=j+1; k < n; k++){
					double e = p[k].real();
					double f = p[k].imag();
					Point center;
					double r;
					auto w = ccw(p[i], p[j], p[k]);
					if(w == 2){
						center = 0.5 * (p[j] + p[k]);
						r = 0.5 * abs(p[j]-p[k]);
					}
					else if(w == -2){
						center = 0.5 * (p[i] + p[k]);
						r = 0.5 * abs(p[i]-p[k]);
					}else if(w == 0){
						center = 0.5 * (p[i] + p[j]);
						r = 0.5 * abs(p[i]-p[j]);
					}else{
						Line l1 = ParpendicularBisectorLine(p[i], p[j]);
						Line l2 = ParpendicularBisectorLine(p[i], p[k]);
						center = crosspoint(l1, l2);
						r = abs(center - p[i]);
					}
					bool flag = true;
					for(int l=0; l < n; l++){
						if(l == i || l == j || l == k)continue;
						if(abs(center-p[l]) - r > EPS){
							flag = false;
							break;
						}
					}
					if(flag)updmin(ans, r);
				}
			}
		}
		for(int i=0; i < n; i++){
			for(int j=i+1; j < n; j++){
				Point center = 0.5 * (p[i] + p[j]);
				double r = 0.5 * abs(p[i]-p[j]);
				bool flag = true;
				for(int l=0; l < n; l++){
					if(l == i || l == j)continue;
					if(abs(center-p[l]) - r > EPS){
						flag = false;
						break;
					}
				}
				if(flag)updmin(ans, r);
			
			}
		}
		cout << setprecision(12) << ans << endl;
 
		return;
	};
};
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}