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.15.1) (judge verdict: Accepted)

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [(f64, f64); n]
    }
    let mut ans: f64 = 1000000.0;
    for i in 0..n {
        for j in i + 1..n {
            let c = ((v[i].0 + v[j].0) / 2.0, (v[i].1 + v[j].1) / 2.0);
            let r2 = dist2(c, v[i]);
            let mut f = true;
            for l in 0..n {
                if dist2(c, v[l]) > r2 * (1.0 + 1e-9) {
                    f = false;
                    break;
                }
            }
            if f {
                ans = ans.min(r2.sqrt());
            }
            'next: for k in j + 1..n {
                let (c, r2) = center(v[i], v[j], v[k]);
                for l in 0..n {
                    if dist2(c, v[l]) > r2 * (1.0 + 1e-9) {
                        continue 'next;
                    }
                }
                ans = ans.min(r2.sqrt());
            }
        }
    }
    println!("{}", ans);
}

fn dist2(p: (f64, f64), q: (f64, f64)) -> f64 {
    (p.0 - q.0).powi(2) + (p.1 - q.1).powi(2)
}

fn center(p: (f64, f64), q: (f64, f64), r: (f64, f64)) -> ((f64, f64), f64) {
    let d = ((q.0 - p.0) * (r.1 - p.1) - (q.1 - p.1) * (r.0 - p.0)) * 2.0;
    if d.abs() < 1e-9 {
        ((0.0, 0.0), -1.0)
    } else {
        let o = (0.0, 0.0);
        let cx = ((q.1 - r.1) * dist2(o, p) + (r.1 - p.1) * dist2(o, q) + (p.1 - q.1) * dist2(o, r)) / d;
        let cy = - ((q.0 - r.0) * dist2(o, p) + (r.0 - p.0) * dist2(o, q) + (p.0 - q.0) * dist2(o, r)) / d;
        ((cx, cy), dist2((cx, cy), p))
    }
}