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)

#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, parser) => {
        $next
    };

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

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

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1e9 as usize + 9;

fn main() {
    input! {
        n: usize,
        p: [(f64, f64); n],
    }

    let mut ans = 1e10;

    for i in 0..n {
        for j in i + 1..n {
            let cx = (p[i].0 + p[j].0) / 2.0;
            let cy = (p[i].1 + p[j].1) / 2.0;

            let cl = ((p[j].0 - p[i].0) * (p[j].0 - p[i].0)
                + (p[j].1 - p[i].1) * (p[j].1 - p[i].1))
                .sqrt();

            let mut r = 1000 as f64 * 1000 as f64;
            let mut l = 0.0;
            for _ in 0..50 {
                let mid = (r + l) / 2.0;
                let dl = (mid * mid - cl * cl / 4.0).sqrt();
                // -y, x
                let nx = -(p[i].1 - p[j].1) / cl * dl + cx;
                let ny = (p[i].0 - p[j].0) / cl * dl + cy;
                let mut ok = true;
                // println!("{} {} {} {}", nx, ny, mid, dl);
                for k in 0..n {
                    let l = ((p[k].0 - nx) * (p[k].0 - nx) + (p[k].1 - ny) * (p[k].1 - ny)).sqrt();
                    // println!("{} {}", l, mid);
                    ok &= l < mid + 1e-7;
                }
                if ok {
                    r = mid;
                } else {
                    l = mid;
                }
            }
            // println!("{}", r);
            if r < ans {
                ans = r;
            }
            let mut r = 1000 as f64 * 1000 as f64;
            let mut l = 0.0;
            for _ in 0..50 {
                let mid = (r + l) / 2.0;
                let dl = (mid * mid - cl * cl / 4.0).sqrt();
                // y, -x
                let nx = (p[i].1 - p[j].1) / cl * dl + cx;
                let ny = -(p[i].0 - p[j].0) / cl * dl + cy;
                let mut ok = true;
                for k in 0..n {
                    let l = ((p[k].0 - nx) * (p[k].0 - nx) + (p[k].1 - ny) * (p[k].1 - ny)).sqrt();

                    // println!("{} {}", l, mid);
                    ok &= l < mid + 1e-7;
                }
                if ok {
                    r = mid;
                } else {
                    l = mid;
                }
            }
            // println!("{}", r);
            if r < ans {
                ans = r;
            }
        }
    }
    println!("{}", ans);
}