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)

typedef int ll;

#include <bits/stdc++.h>
using namespace std;
// 感謝
// http://www.iot-kyoto.com/satoh/2016/01/29/tangent-003/
int calcCircleOf2Point(int x1, int y1, int x2, int y2, int x3, int y3, long double *cx, long double *cy, long double *r)
{
	long double 	ox, oy, a, b, c, d ;
	long double 	r1, r2, r3 ;
	int		stat ;

	a = x2 - x1 ;
	b = y2 - y1 ;
	c = x3 - x1 ;
	d = y3 - y1 ;

	stat = -1 ;

	if  ((a && d) || (b && c)) {
		ox = x1 + (d * (a * a + b * b) - b * (c * c + d * d)) / (a * d - b * c) / 2 ;
		if  (b) {
			oy = (a * (x1 + x2 - ox - ox) + b * (y1 + y2)) / b / 2 ;
		} else {
			oy = (c * (x1 + x3 - ox - ox) + d * (y1 + y3)) / d / 2 ;
		}
		r1   = sqrt((ox - x1) * (ox - x1) + (oy - y1) * (oy - y1)) ;
		r2   = sqrt((ox - x2) * (ox - x2) + (oy - y2) * (oy - y2)) ;
		r3   = sqrt((ox - x3) * (ox - x3) + (oy - y3) * (oy - y3)) ;
		*cx = ox ;
		*cy = oy ;
		*r  = (r1 + r2 + r3) / 3 ;
		stat = 0 ;
	}

	return stat ;
}
int main() {
    ll n;
    std::cin >> n;
    
    vector<pair<long double,long double>> xy(n);
    
    for (int i = 0; i < n; i++) {
        std::cin >> xy[i].first>>xy[i].second;
    }
    
    long double ans = 1e15;
    
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            bool ok = true;
        
            long double cx = (xy[i].first+xy[j].first)/2.0;
            long double cy = (xy[i].second+xy[j].second)/2.0;
            long double cr = sqrt((xy[i].first-xy[j].first)*(xy[i].first-xy[j].first)+(xy[i].second-xy[j].second)*(xy[i].second-xy[j].second))/2.0;
            for (int t = 0; t < n; t++) {
                if( (xy[t].first-cx)*(xy[t].first-cx)+(xy[t].second-cy)*(xy[t].second-cy) > cr*cr ){
                    ok=false;
                    break;
                }
            }
            if(ok){
                ans = min(ans,cr);
            }
        }
    }
    
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            for (int k = j+1; k < n; k++) {
                long double cx,cy,cr;
                if(calcCircleOf2Point(xy[i].first,xy[i].second,xy[j].first,xy[j].second,xy[k].first,xy[k].second,&cx,&cy,&cr)!=-1){
                    bool ok = true;
                    // std::cout << 1 << std::endl;
                    for (int t = 0; t < n; t++) {
                        if( (xy[t].first-cx)*(xy[t].first-cx)+(xy[t].second-cy)*(xy[t].second-cy) > cr*cr ){
                            ok=false;
                            break;
                        }
                    }
                    if(ok){
                        ans = min(ans,cr);
                    }
                }
            }
        }
    }
    std::cout <<setprecision(20)<< ans << std::endl;
}