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: Wrong Answer)

#[test]
fn check_solve() {
    //println!("input:\n2\n0 0\n1 0\noutput:\n{}\n", solve("2\n0 0\n1 0\n"));
    //println!("input:\n3\n0 0\n0 1\n1 0\noutput:\n{}\n", solve("3\n0 0\n0 1\n1 0\n"));
    println!("input:\n10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\noutput:\n{}\n", solve("10\n10 9\n5 9\n2 0\n0 0\n2 7\n3 3\n2 5\n10 0\n3 7\n1 9\n"));
}

type Point = (f64, f64);

fn solve(src: &str) -> String {
    let mut sc = Scanner::from_str(src);

    let n: usize = sc.read();
    let xy: Vec<Point> = (0..n).map(|_| (sc.read(), sc.read())).collect();

    let mut scr = 9999999999.9;

    for i in 0..n {
        for j in 0..n {
            'klp: for k in 0..n {
                if i == j || j == k {
                    continue;
                }
                let (c, r) = ccenter(xy[i], xy[j], xy[k]);
                for l in 0..n {
                    if dist(c, xy[l]) > r {
                        continue 'klp;
                    }
                }
                if r < scr {
                    scr = r;
                }
            }
        }
    }
    format!("{}\n", scr)
}

fn dist(p: Point, q: Point) -> f64 {
    ((p.0 - q.0)*(p.0 - q.0) + (p.1 - q.1)*(p.1 - q.1)).sqrt()
}
 
fn ccenter(p: Point, q: Point, r: Point) -> (Point, f64) {
    let a = -1.0 / line(p, q);
    let b = -1.0 / line(q, r);
    let m = ((p.0+q.0)/2.0, (p.1+q.1)/2.0);
    let n = ((q.0+r.0)/2.0, (q.1+r.1)/2.0);
    //y - m.1 = a * (x - m.0)
    //y - n.1 = b * (x - n.0)
    let x = (n.1 - m.1) / (a-b) + m.0 - n.0;
    let y = m.1 + a * (x - m.0);
    let c = (x, y);
    (c, dist(c, p))
}

fn line(p: Point, q: Point) -> f64 {
    (q.1 - p.1 + 0.00000001)/(q.0 - p.0 + 0.000000001)
}

fn main() {
    let mut buf = String::new();
    use std::io;
    use std::io::{Read, Write};
    io::stdin().read_to_string(&mut buf).unwrap();
    io::stdout().write_all(solve(&buf).as_bytes()).unwrap();
}

struct Scanner<'a>(std::str::SplitWhitespace<'a>);
impl<'a> Scanner<'a> {
    fn from_str(src: &str) -> Scanner {
        Scanner(src.split_whitespace())
    }
    fn get(&mut self) -> &str {
        self.0.next().unwrap()
    }
    fn read<T: std::str::FromStr>(&mut self) -> T {
        self.get().parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.get().chars().collect()
    }
}