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.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class ABC151F
    {
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }

        static public void Solve()
        {
            var N = NN;
            var xy = Repeat(0, N).Select(_ => new { x = NN, y = NN }).ToArray();
            var geo = new LIB_Geo2D();
            foreach (var item in xy)
            {
                geo.AddPoint(item.x, item.y);
            }
            Console.WriteLine(geo.GetEncloseCircle().r);
        }
        static class Console_
        {
            static Queue<string> param = new Queue<string>();
            public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }
        static long NN => long.Parse(Console_.NextString());
        static double ND => double.Parse(Console_.NextString());
        static string NS => Console_.NextString();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static IEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => x.OrderBy(_ => xorshift);
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
    class LIB_Geo2D
    {
        static readonly double EPS = 1e-10;
        public struct Point
        {
            public double x;
            public double y;
            static public Point operator +(Point a, Point b) => new Point() { x = a.x + b.x, y = a.y + b.y };
            static public Point operator -(Point a, Point b) => new Point() { x = a.x - b.x, y = a.y - b.y };
            static public Point operator *(Point p, double v) => new Point() { x = p.x * v, y = p.y * v };
            static public Point operator *(double v, Point p) => p * v;
            static public Point operator /(Point p, double v) => new Point() { x = p.x / v, y = p.y / v };
            static public Point operator /(double v, Point p) => p / v;
        }
        double Norm(Point p) => p.x * p.x + p.y * p.y;
        double Cross(Point p1, Point p2) => p1.x * p2.y - p1.y * p2.x;
        public struct Circle
        {
            public Point p;
            public double r;
        }
        List<Point> pointList;
        public LIB_Geo2D()
        {
            pointList = new List<Point>();
        }
        public void AddPoint(double x, double y)
        {
            pointList.Add(new Point() { x = x, y = y });
        }
        public Circle GetEncloseCircle()
        {
            if (pointList.Count < 2) throw new Exception();
            var rnd = new Random();
            var list = pointList.OrderBy(_ => rnd.Next()).ToArray();
            Func<Point, Point, Point, Circle> mc3 = null;
            mc3 = (a, b, c) =>
            {
                var A = Norm(b - c);
                var B = Norm(c - a);
                var C = Norm(a - b);
                var S = Abs(Cross(b - a, c - a));
                var p = (A * (B + C - A) * a + B * (C + A - B) * b + C * (A + B - C) * c) / (4 * S * S);
                var r = Norm(p - a);
                return new Circle() { p = p, r = r };
            };
            Func<Point, Point, Circle> mc2 = null;
            mc2 = (a, b) =>
            {
                var c = (a + b) / 2;
                return new Circle() { p = c, r = Norm(a - c) };
            };
            Func<Point, Circle, bool> inCircle = null;
            inCircle = (p, c) => Norm(p - c.p) <= c.r + EPS;
            {
                var c = mc2(list[0], list[1]);
                for (var i = 2; i < list.Length; i++)
                {
                    if (!inCircle(list[i], c))
                    {
                        c = mc2(list[0], list[i]);
                        for (var j = 1; j < i; j++)
                        {
                            if (!inCircle(list[j], c))
                            {
                                c = mc2(list[i], list[j]);
                                for (var k = 0; k < j; k++)
                                {
                                    if (!inCircle(list[k], c))
                                    {
                                        c = mc3(list[i], list[j], list[k]);
                                    }
                                }
                            }
                        }
                    }
                }
                return new Circle() { p = c.p, r = Sqrt(c.r) };
            }
        }
    }
}