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 <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <vector>
#include <queue>
using namespace std;
typedef long long LL;
const double eps = 1e-10;

LL n;
double ans,r;

struct Point{
	double x,y;
}s[55];

double dist(LL x,LL y){
	return sqrt((s[x].x - s[y].x) * (s[x].x - s[y].x) + (s[y].y - s[x].y) * (s[y].y - s[x].y));
}

LL judge(double rr){
	for(LL i = 1;i <= n;i ++){
		if(dist(i,n + 1) > rr + eps) return 0;
	}
	return 1;
}

Point mkpoint(double x,double y){
	Point ret;
	ret.x = x; ret.y = y;
	return ret;
}

Point waixin(Point a,Point b,Point c){ 
  double a1 = b.x - a.x, b1 = b.y - a.y, c1 = (a1*a1 + b1*b1)/2.0; 
  double a2 = c.x - a.x, b2 = c.y - a.y, c2 = (a2*a2 + b2*b2)/2.0; 
  double d = a1*b2 - a2*b1;
  if(d < eps && d > -eps) return mkpoint(-10000.0,-10000.0);
  return mkpoint(a.x + (c1*b2 - c2*b1)/d, a.y + (a1*c2 -a2*c1)/d); 
}

int main(){
	cin >> n; ans = 1e6;
	for(LL i = 1;i <= n;i ++) cin >> s[i].x >> s[i].y;
	for(LL i = 1;i <= n;i ++){
		s[i].x += 1001.0;
		s[i].y += 1001.0;
	}
	
	// 2 points
	for(LL i = 1;i <= n;i ++){
		for(LL j = 1;j <= n;j ++){
			if(i == j) continue;
			s[n + 1].x = (s[i].x + s[j].x) / 2.0; s[n + 1].y = (s[i].y + s[j].y) / 2.0;
			r = dist(i,j) / 2.0;
			if(judge(r)) ans = min(ans,dist(i,j) / 2.0);
		}
	}
	//
	
	// 3 points
	for(LL i = 1;i <= n;i ++){
		for(LL j = 1;j <= n;j ++){
			for(LL k = 1;k <= n;k ++){
				if(i == j || j == k || k == i) continue;
				s[n + 1] = waixin(s[i],s[j],s[k]);
//         		x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
//          	y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))
//				cout << s[n + 1].x << ' ' << s[n + 1].y << endl;
				r = dist(n + 1,j);
//				cout << r << endl;
				if(judge(r)) ans = min(ans,dist(n + 1,i));
			}
		}
	}
	//
	printf("%.10lf\n",ans);
	return 0;
}