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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;


public class EncloseAll
{

  public class Point
  {
    public double X;
    public double Y;
    public Point()
    {
    }
    public Point(double x, double y)
    {
      X = x;
      Y = y;
    }
  }
  
  public class Circle
  {
    public double X;
    public double Y;
    public double L;
    
    public Circle()
    {
    }
    public Circle(double x, double y,double l)
    {
      X = x;
      Y = y;
      L = l;
    }
  }

  
　public static bool ccw(Point p1, Point p2, Point p3)
  {
  	return  (p2.X - p3.X) * (p1.Y - p2.Y) == (p1.X - p2.X) * (p2.Y - p3.Y);
  }
  
  public static Circle gaisin3(Point p1,Point p2, Point p3)
  {
    double G = (p2.Y * p1.X - p1.Y * p2.X + p3.Y * p2.X - p2.Y * p3.X + p1.Y * p3.X - p3.Y * p1.X);
    double Xc = ((p1.X * p1.X + p1.Y * p1.Y) * (p2.Y - p3.Y) + (p2.X * p2.X + p2.Y * p2.Y) * (p3.Y - p1.Y) + (p3.X * p3.X + p3.Y * p3.Y) * (p1.Y - p2.Y)) / (2 * G);
    double Yc = -((p1.X * p1.X + p1.Y * p1.Y) * (p2.X - p3.X) + (p2.X * p2.X + p2.Y * p2.Y) * (p3.X - p1.X) + (p3.X * p3.X + p3.Y * p3.Y) * (p1.X - p2.X)) / (2 * G);
    double Xd = (((p1.X * p1.X + p1.Y * p1.Y) - (p2.X * p2.X + p2.Y * p2.Y)) * (p2.Y - p3.Y) - ((p2.X * p2.X + p2.Y * p2.Y) - (p3.X * p3.X + p3.Y * p3.Y)) * (p1.Y - p2.Y)) / (2 * ((p1.X - p2.X) * (p2.Y - p3.Y) - (p2.X - p3.X) * (p1.Y - p2.Y)));
    double Yd = (((p1.Y * p1.Y + p1.X * p1.X) - (p2.Y * p2.Y + p2.X * p2.X)) * (p2.X - p3.X) - ((p2.Y * p2.Y + p2.X * p2.X) - (p3.Y * p3.Y + p3.X * p3.X)) * (p1.X - p2.X)) / (2 * ((p1.Y - p2.Y) * (p2.X - p3.X) - (p2.Y - p3.Y) * (p1.X - p2.X)));
    double L = 2 * Math.Sqrt((p1.X - Xc) * (p1.X - Xc) + (p1.Y - Yc) * (p1.Y - Yc));
 	return new Circle(Xd,Yd,L);
  }
  
  public static Circle gaisin2(Point p1,Point p2)
  {
    Point p = new Point((p1.X+p2.X)/2.0, (p1.Y+p2.Y)/2.0);
    double L = Math.Sqrt((p1.X-p.X)*(p1.X-p.X) + (p1.Y-p.Y)*(p1.Y-p.Y));
   	return new Circle(p.X,p.Y,L*2);
  }
  
  public static bool inPoint(Point p,Circle c)
  {
     double L = Math.Sqrt((p.X-c.X)*(p.X-c.X) + (p.Y-c.Y)*(p.Y-c.Y));
   	 return L <= (c.L/2.0);
  }
  
   static void Main(string[] args) 
   {
     int N = int.Parse(Console.ReadLine());
     Point[] pos = new Point[N];
     
	for(int i=0;i<N;i++)
    {	
      	var b = Console.ReadLine().Split(' ');
  		pos[i] = new Point(double.Parse(b[0]),double.Parse(b[1]));
    }
    

     double minL=100000;
     Circle res = new Circle();
     Circle minRes = new Circle();
     
     for(int i=0;i<N;i++)
     {
       for(int j=i+1;j<N;j++)
       {
         res = gaisin2(pos[i],pos[j]);
         bool flg=false;
         for(int n=0;n<N;n++)
         {
         	if(!inPoint(pos[n],res)){flg=true;}
         }         
         if(!flg && res.L <= minL){minL = res.L;minRes=res;}
       }
     }
    

     for(int i=0;i<N;i++)
     {
       for(int j=i+1;j<N;j++)
       {
         for(int k=0;k<N;k++)
         {
           if(!ccw(pos[i],pos[j],pos[k]))
           {
             res = gaisin3(pos[i],pos[j],pos[k]);
           	 bool flg=false;
             for(int n=0;n<N;n++)
             {
               if(!inPoint(pos[n],res)){flg=true;}
             }         
             if(!flg && res.L <= minL){minL = res.L;minRes=res;}
           }
         }
       }
     }
     

     Console.WriteLine(minRes.L/2);
    
   }
  

  
}