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)

use std::cmp::max;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let mut ret = 0f64;
    let n: usize = parse!(it);
    let p: Vec<(f64, f64)> = (0..n).map(|_| parse!(it, 2)).collect();
    let cos = |a: f64, b: f64, c: f64| (b.powi(2) + c.powi(2) - a.powi(2)) / 2f64 / b / c;
    let l = |p: (f64, f64), q: (f64, f64)| ((p.0 - q.0).powi(2) + (p.1 - q.1).powi(2)).sqrt();
    for i in 0..n {
        for j in (i + 1)..n {
            for k in (j + 1)..n {
                let a = l(p[i], p[j]);
                let b = l(p[j], p[k]);
                let c = l(p[k], p[i]);
                let cosa = cos(a, b, c);
                let cosb = cos(b, c, a);
                let cosc = cos(c, a, b);
                if cosa < 0. || cosb < 0. || cosc < 0. {
                    ret = if ret < a / 2. { a / 2. } else { ret };
                    ret = if ret < b / 2. { b / 2. } else { ret };
                    ret = if ret < c / 2. { c / 2. } else { ret };
                } else {
                    let r =
                        a * b * c / ((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c)).sqrt();
                    ret = if ret < r { r } else { ret };
                }
            }
        }
    }
    if n == 2 {
        ret = l(p[0], p[1]) / 2.;
    }
    println!("{}", ret);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}