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: Wrong Answer)

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;

namespace A
{
    class StartingPoint
    {
        static void Main(string[] args)
        {
            if (args?.Any() == true)
            {
                var assembly = Assembly.GetEntryAssembly();
                var resourceName = "AtCoderCSharp.In.txt";
                var stream = assembly.GetManifestResourceStream(resourceName);
                var streamReader = new StreamReader(stream, Encoding.UTF8);
                var str = streamReader.ReadToEnd();
                var textReader = new StringReader(str);
                Console.SetIn(textReader);
            }

            try
            {
                foreach (var s in new Program().Solve())
                {
                    Console.WriteLine(s);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                if (args?.Any() != true)
                    throw e;
            }

            if (args?.Any() == true)
                Console.ReadKey();
        }
    }

    class Program
    {
        public List<int> ScanInts(int count) => Enumerable.Range(0, count).Select(_ => ScanInt).ToList();
        public List<int> ScanInts(long count) => ScanInts((int)count);
        public List<long> ScanLongs(int count) => Enumerable.Range(0, count).Select(_ => Scan).ToList();
        public List<long> ScanLongs(long count) => ScanLongs((int)count);
        public int ScanInt => int.Parse(Str);
        public long Scan => long.Parse(Str);
        public double ScanDouble => (double)Scan;

        StringBuilder sb = new StringBuilder();

        public string Str => ScanStr();
        public string ScanStr()
        {
            sb.Clear();

            int r = 0;
            bool? b = null;
            do
            {
                r = Console.Read();
                b = IsBreak(r);
            } while (b == true);

            if (b == null)
                throw new Exception("input error: unexpected end of stream");

            do
            {
                sb.Append((char)r);
                r = Console.Read();
                b = IsBreak(r);
            } while (b == false);

            return sb.ToString();
        }

        bool? IsBreak(int c)
        {
            switch (c)
            {
                case -1:
                    return null;
                case (int)' ':
                case (int)'\n':
                case (int)'\r':
                    return true;
                default:
                    return false;
            }
        }

        public IEnumerable<int> Loop(int count) => Enumerable.Range(0, count);
        public IEnumerable<int> Loop(int from, int to) => Enumerable.Range(from, to - from + 1);

        public IEnumerable<long> Loop(long count) => Loop(0, count - 1);
        public IEnumerable<long> Loop(long from, long to)
        {
            for (long i = from; i <= to; i++)
                yield return i;
        }

        public string YesNo(bool isYes) => isYes ? "Yes" : "No";

        public HashSet<T> ToHashSet<T>(IEnumerable<T> ts) => new HashSet<T>(ts);

        public struct Point
        {
            public double x;
            public double y;
        }

        double Dist(Point a, Point b)
        {
            return Math.Sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
        }

        double Rad(Point a, Point b, Point c)
        {
            var res = 0d;

            var ab = Dist(a, b);
            var bc = Dist(b, c);
            var ca = Dist(c, a);

            if ((a.x - b.x) * (a.y - c.y) == (a.y - b.y) * (a.x - c.x))
            {
                res = Math.Max(res, ab / 2d);
                res = Math.Max(res, bc / 2d);
                res = Math.Max(res, ca / 2d);
            }
            else
            {
                var s = (ab + bc + ca) / 2d;
                var ss = Math.Sqrt(s * (s - ab) * (s - bc) * (s - ca));

                var r = ab * bc * ca / 4d / ss;
                res = Math.Max(res, r);
            }

            return res;
        }

        public IEnumerable<string> Solve()
        {
            var n = ScanInt;
            var ps = new List<Point>();

            foreach (var i in Loop(n))
            {
                ps.Add(new Point() { x = ScanInt, y = ScanInt });
            }

            if (n == 2)
            {
                yield return (Dist(ps[0], ps[1]) / 2d).ToString();
                yield break;
            }

            var maxd = 0d;
            var cand = new int[] { 0, 1 };

            for (int i = 0; i < n; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    var d = Dist(ps[i], ps[j]);

                    if (maxd < d)
                    {
                        maxd = d;
                        cand = new int[] { i, j };
                    }
                }
            }

            var res = maxd / 2d;

            for (int i = 0; i < n; i++)
            {
                if (cand.Contains(i))
                    continue;

                var a = ps[cand[0]];
                var b = ps[cand[1]];
                var c = ps[i];

                var ab = Dist(a, b);
                var bc = Dist(b, c);
                var ca = Dist(c, a);

                if (ca * ca + ab * ab - bc * bc >= 0)
                    continue;

                var cd = Rad(a, b, c);
                res = Math.Max(cd, res);
            }


            yield return res.ToString();
        }
    }
}