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 JavaScript (node.js v5.12) (judge verdict: Accepted)

"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}
var r,rx,ry,xy,n;
var e = 1-1e-9;
var ans = 1e9;

console.log(main());
function main(){
  n = o.a();
  xy = o.m(n);
  if(n === 2)return solve2(xy);
  for(var i = 0; i < n; i++)for(var j = i+1; j < n; j++){
    if(solve3(xy[i][0],xy[i][1],xy[j][0],xy[j][1])){
      ans = r;
    }
  }
  for(var i = 0; i < n; i++)for(var j = i+1; j < n; j++)for(var k = j+1; k < n; k++){
    if(solve(xy[i][0],xy[i][1],xy[j][0],xy[j][1],xy[k][0],xy[k][1])){
      ans = r;
    }
  }
  return ans;
}

function solve(x1,y1,x2,y2,x3,y3){
  var a = x1-x2, b = y1-y2, c = x2-x3, d = y2-y3;
  var k = 2*(a*d-b*c);
  if(k === 0){//一直線上
    return;
  }
  var v1 = x1*x1+y1*y1, v2 = x2*x2+y2*y2, v3 = x3*x3+y3*y3;
  k = 1/k;
  rx = k*(d*(v1-v2)-b*(v2-v3));
  ry = k*(a*(v2-v3)-c*(v1-v2));
  var dx = x1-rx, dy = y1-ry;
  r = Math.sqrt(dx*dx+dy*dy);
  return f();
}

function f(){
  if(ans < r)return;
  for(var i = 0; i < n; i++){
    var dx = xy[i][0]-rx, dy = xy[i][1]-ry;
    var rr = Math.sqrt(dx*dx+dy*dy);
    if(r < rr*e)return;
  }
  return 1;
}

function solve3(x1,y1,x2,y2){
  var dx = x1-x2, dy = y1-y2;
  rx = (x1+x2)/2, ry = (y1+y2)/2;
  r = Math.sqrt(dx*dx+dy*dy)/2;
  return f();
}

function solve2(x){
  var dx = x[0][0]-x[1][0], dy = x[0][1]-x[1][1];
  return Math.sqrt(dx*dx+dy*dy)/2;
}