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;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		const long MOD = 1000000007;

		static void Main(string[] args)
		{
			var cin = new Scanner2();
			int n = cin.Int();
			var xy = new DXY[n];
			for (int i = 0; i < n; i++) {
				double x = cin.Int();
				double y = cin.Int();
				xy[i] = new DXY(x, y);
			}

			double delta = 0;
			double ans = 20000;
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (i == j) {
						continue;
					}

					for (int k = 0; k < n; k++) {
						if (i == k || j == k) {
							continue;
						}

						double a = Length(xy[i], xy[j]);
						double b = Length(xy[j], xy[k]);
						double c = Length(xy[k], xy[i]);
						DXY center = Circumcenter(xy[i], xy[j], xy[k]);
						double r = RadiusOfCircumcircle(a, b, c);

						bool ok = true;
						for (int l = 0; l < n; l++) {
							double d = Length(center, xy[l]);
							if (d > r + delta) {
								ok = false;
								break;
							}
						}

						if (ok) {
							ans = Math.Min(ans, r);
						}
					}
				}
			}

			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (i == j) {
						continue;
					}

					double r = Length(xy[i], xy[j]) / 2;
					DXY center = new DXY((xy[i].X + xy[j].X) / 2, (xy[i].Y + xy[j].Y) / 2);

					bool ok = true;
					for (int l = 0; l < n; l++) {
						double d = Length(center, xy[l]);
						if (d > r + delta) {
							ok = false;
							break;
						}
					}

					if (ok) {
						ans = Math.Min(ans, r);
					}
				}
			}

			Console.WriteLine(ans);
		}

		private static double Length(DXY p, DXY q) 
		{
			double x = p.X - q.X;
			double y = p.Y - q.Y;
			return Math.Sqrt(x * x + y * y);
		}

		private static DXY Circumcenter(DXY A, DXY B, DXY C)
		{
			double a = Length(B, C);
			double b = Length(C, A);
			double c = Length(A, B);

			double a2 = a * a;
			double b2 = b * b;
			double c2 = c * c;

			double denominator = a2 * (b2 + c2 - a2) + b2 * (a2 + c2 - b2) + c2 * (a2 + b2 - c2);
			double x = a2 * (b2 + c2 - a2) * A.X + b2 * (a2 + c2 - b2) * B.X + c2 * (a2 + b2 - c2) * C.X
				/ denominator;
			double y = a2 * (b2 + c2 - a2) * A.Y + b2 * (a2 + c2 - b2) * B.Y + c2 * (a2 + b2 - c2) * C.Y
				/ denominator;

			return new DXY(x, y);
		}

		private static double RadiusOfCircumcircle(double a, double b, double c)
		{
			return a * b * c
				/ Math.Sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c));
		}
	}

	public struct DXY
	{
		public double X { get; set; }
		public double Y { get; set; }

		public DXY(double x, double y)
		{
			X = x;
			Y = y;
		}

		public override int GetHashCode()
		{
			var hashCode = 1861411795;
			hashCode = hashCode * -1521134295 + X.GetHashCode();
			hashCode = hashCode * -1521134295 + Y.GetHashCode();
			return hashCode;
		}
	}

	public class Scanner2
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private readonly string filePath_;
		private string[] buf_;
		private int index_;
		Func<string> reader_;

		public Scanner2(string file = "")
		{
			if (string.IsNullOrWhiteSpace(file)) {
				reader_ = Console.ReadLine;
			} else {
				filePath_ = file;
				var fs = new StreamReader(file);
				reader_ = fs.ReadLine;
			}
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = reader_();
			while (st == "") {
				st = reader_();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}

		public void Save(string text)
		{
			if (string.IsNullOrWhiteSpace(filePath_)) {
				return;
			}

			File.WriteAllText(filePath_ + "_output.txt", text);
		}
	}
}