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 Java8 (OpenJDK 1.8.0) (judge verdict: Wrong Answer)

import java.util.*;
import java.io.*;
public class Main {
    static final double phi = (1.0 + Math.sqrt(5)) / 2;
    static final double phi_1 = phi - 1;
    static final double C1 = 1000 * (1 - phi_1);
    static final double C2 = 1000 * phi_1;
    static int N;
    static int[] X, Y;
    static InputStreamReader r;
    public static void main(String[] args) throws Exception {
        r = new InputStreamReader(System.in);
        N = nextInt();
        X = new int[N];
        Y = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = nextInt();
            Y[i] = nextInt();
        }

        double x = calc(0, C1, C2, 1000);
        System.out.println(calc_r(x, calc_y(0, C1, C2, 1000, x)));
    }

    public static double calc(double low, double x1, double y2, double high) {
        if (y2 - x1 < 0.0000001) return x1;

        if (calc_r(x1, calc_y(0, x1, y2, 1000, x1)) < calc_r(y2, calc_y(0, x1, y2, 1000, y2))) {
            return calc(low, low + (y2 - low) * (1 - phi_1), x1, y2);
        } else {
            return calc(x1, y2, x1 + (high - x1) * (phi_1), high);
        }
    }

    public static double calc_y(double low, double y1, double y2, double high, double x) {
        if (y2 - y1 < 0.0000001) return y1;

        if (calc_r(x, y1) < calc_r(x, y2)) {
            return calc_y(low, low + (y2 - low) * (1 - phi_1), y1, y2, x);
        } else {
            return calc_y(y1, y2, y1 + (high - y1) * (phi_1), high, x);
        }
    }

    public static double calc_r(double x, double y) {
        double r = 0;
        for (int i = 0; i < N; i++) {
            double dx = x - X[i];
            double dy = y - Y[i];
            r = Math.max(r, Math.sqrt(dx * dx + dy * dy));
        }
        return r;
    }

    public static String nextString() throws Exception {
        String res = "";
        while (true) {
            int c = r.read();
            if (c == 32 || c == 10 || c == -1) {
                break;
            }
            res += (char)c;
        }
        return res;
    }

    public static int nextInt() throws Exception {
        return Integer.parseInt(nextString());
    }

    public static long nextLong() throws Exception {
        return Long.parseLong(nextString());
    }

    public static double nextDouble() throws Exception {
        return Double.parseDouble(nextString());
    }
}