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 Rust (1.42.0) (judge verdict: Wrong Answer)

fn main() {
    let n: usize = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        buf.trim_end().parse().unwrap()
    };
    let [x, y]: [Vec<f64>; 2] = {
        let mut x = Vec::with_capacity(n);
        let mut y = Vec::with_capacity(n);
        for _ in 0..n {
            let [a, b]: [f64; 2] = {
                let mut buf = String::new();
                std::io::stdin().read_line(&mut buf).unwrap();
                let mut iter = buf.split_whitespace();
                [
                    iter.next().unwrap().parse().unwrap(),
                    iter.next().unwrap().parse().unwrap(),
                ]
            };
            x.push(a);
            y.push(b);
        }
        [x, y]
    };

    let mut ans = std::f64::MAX;

    let d = |x1: f64, y1: f64, x2: f64, y2: f64| {
        (x1 - x2).powi(2) + (y1 - y2).powi(2)
    };

    let mut f = |p: f64, q: f64| {
        let mut res: f64 = 0.0;
        for i in 0..n {
            res = res.max(d(p, q, x[i], y[i]));
        }
        ans = ans.min(res.sqrt());
    };

    for i in 0..n {
        for j in (i + 1)..n {
            {
                let p = (x[i] + x[j]) / 2.0;
                let q = (y[i] + y[j]) / 2.0;
                f(p, q);    
            }
            for k in (j + 1)..n {
                let a = d(x[j], y[j], x[k], y[k]);
                let b = d(x[k], y[k], x[i], y[i]);
                let c = d(x[i], y[i], x[j], y[j]);
                if (b.sqrt() + c.sqrt() - a.sqrt()).abs() < std::f64::EPSILON { continue; }
                if (c.sqrt() + a.sqrt() - b.sqrt()).abs() < std::f64::EPSILON { continue; }
                if (a.sqrt() + b.sqrt() - c.sqrt()).abs() < std::f64::EPSILON { continue; }
                let u = a * (b + c - a);
                let v = b * (c + a - b);
                let w = c * (a + b - c);
                let p = (u * x[i] + v * x[j] + w * x[k]) / (u + v + w);
                let q = (u * y[i] + v * y[j] + w * y[k]) / (u + v + w);
                f(p, q);
            }
        }
    }

    println!("{:.10}", ans);
}