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)

#[macro_use]
mod input_mcr {
    // ref: tanakh <https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8>
    // diff: using Parser
    #[macro_export(local_inner_macros)]
    macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut parser = Parser::from_str($s);
        input_inner!{parser, $($r)*}
    };
    (parser = $parser:ident, $($r:tt)*) => {
        input_inner!{$parser, $($r)*}
    };
    (new_stdin_parser = $parser:ident, $($r:tt)*) => {
        let stdin = std::io::stdin();
        let reader = std::io::BufReader::new(stdin.lock());
        let mut $parser = Parser::new(reader);
        input_inner!{$parser, $($r)*}
    };
    ($($r:tt)*) => {
        input!{new_stdin_parser = parser, $($r)*}
    };
}

    #[macro_export(local_inner_macros)]
    macro_rules! input_inner {
    ($parser:ident) => {};
    ($parser:ident, ) => {};
    ($parser:ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($parser, $t);
        input_inner!{$parser $($r)*}
    };
}

    #[macro_export(local_inner_macros)]
    macro_rules! read_value {
    ($parser:ident, ( $($t:tt),* )) => {
        ( $(read_value!($parser, $t)),* )
    };
    ($parser:ident, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($parser, $t)).collect::<Vec<_>>()
    };
    ($parser:ident, chars) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()
    };
    ($parser:ident, char_) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()[0]
    };
    ($parser:ident, usize1) => {
        read_value!($parser, usize) - 1
    };
    ($parser:ident, i64_) => {
        $parser.fast_i64()
    };
    ($parser:ident, usize_) => {
        $parser.fast_i64() as usize
    };
    ($parser:ident, usize1_) => {
        ($parser.fast_i64() - 1) as usize
    };
    ($parser:ident, $t:ty) => {
        $parser.next::<$t>().expect("Parse error")
    };
}

    use std::io;
    use std::io::BufRead;
    use std::str;

    // ref: tatsuya6502 <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e>
    // ref: wariuni <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e#comment-7040a5ae96305e884eb9>
    // diff: using std::io::BufRead::fill_buf()
    pub struct Parser<R> {
        pub reader: R,
        buf: Vec<u8>,
        pos: usize,
    }

    impl Parser<io::Empty> {
        pub fn from_str(s: &str) -> Parser<io::Empty> {
            Parser {
                reader: io::empty(),
                buf: s.as_bytes().to_vec(),
                pos: 0,
            }
        }
    }

    impl<R: BufRead> Parser<R> {
        pub fn new(reader: R) -> Parser<R> {
            Parser {
                reader: reader,
                buf: vec![],
                pos: 0,
            }
        }
        pub fn update_buf(&mut self) {
            self.buf.clear();
            self.pos = 0;
            loop {
                let (len, complete) = {
                    let buf2 = self.reader.fill_buf().unwrap();
                    self.buf.extend_from_slice(buf2);
                    let len = buf2.len();
                    (len, buf2[len - 1] <= 0x20)
                };
                self.reader.consume(len);
                if complete {
                    break;
                }
            }
        }
        pub fn next<T: str::FromStr>(&mut self) -> Result<T, T::Err> {
            loop {
                let mut begin = self.pos;
                while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                    begin += 1;
                }
                let mut end = begin;
                while end < self.buf.len() && (self.buf[end] > 0x20) {
                    end += 1;
                }
                if begin != self.buf.len() {
                    self.pos = end;
                    return unsafe { str::from_utf8_unchecked(&self.buf[begin..end]) }.parse::<T>();
                } else {
                    self.update_buf();
                }
            }
        }
        pub fn fast_i64(&mut self) -> i64 {
            loop {
                let mut begin = self.pos;
                while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                    begin += 1;
                }
                if begin == self.buf.len() {
                    self.update_buf();
                    continue;
                }
                let mut res = 0;
                let (is_positive, mut end) = match self.buf[begin] {
                    b'+' => (true, begin + 1),
                    b'-' => (false, begin + 1),
                    _ => (true, begin),
                };
                while end < self.buf.len() && (self.buf[end] > 0x20) {
                    res = res * 10 + (self.buf[end] as i64 - '0' as i64);
                    end += 1;
                }
                if begin != self.buf.len() {
                    self.pos = end;
                    return if is_positive { res } else { -res };
                } else {
                    self.update_buf();
                }
            }
        }
    }
}

use input_mcr::*;
use std::cmp::*;

use std::ops::*;
#[derive(Clone, Copy, Debug)]
pub struct C {
    x: f64,
    y: f64,
}

impl C {
    pub fn new(x: f64, y: f64) -> C {
        C { x: x, y: y }
    }
    pub fn from_real(x: f64) -> C {
        C { x: x, y: 0.0 }
    }
    pub fn conj(&self) -> Self {
        C {
            x: self.x,
            y: -self.y,
        }
    }
    pub fn norm2(&self) -> f64 {
        self.x * self.x + self.y * self.y
    }
    pub fn abs(&self) -> f64 {
        self.norm2().sqrt()
    }
    pub fn unit(self) -> C {
        self / self.abs()
    }
}

pub fn vertical_bisector(p0: C, p1: C) -> (C, C) {
    let c = (p0 + p1) / 2.0;
    let mut dir = C::new(0.0, 1.0);
    //// eprintln!("p0 = {:?}, p1 = {:?}", p0, p1);
    let r = p1 - p0;
    //// eprintln!("r = {:?}", r);
    //// eprintln!("dir = {:?}", dir);
    dir = dir / r.unit();
    //// eprintln!("dir = {:?}", dir);
    (c, dir)
}

pub fn cross(cd1: (C, C), cd2: (C, C)) -> Option<C> {
    // eprintln!("cd1 = {:?}, cd2 = {:?}", cd1, cd2);
    let (c1, d1) = cd1;
    let (c2, d2) = cd2;
    // check
    if (d1 - d2).abs() < 1e-9 || (d1 + d2).abs() < 1e-9 {
        return None;
    }
    // shift
    let shift = c1;
    //// eprintln!("shift = {:?}", shift);
    let (c1, d1, c2, d2) = (c1 - c1, d1, c2 - c1, d2);
    // rotate
    let rotate = d1.unit();
    //// eprintln!("d1 = {:?}", d1);
    //// eprintln!("rotate = {:?}", rotate);
    let (c1, d1, c2, d2) = (c1, c2 / d1.unit(), c2 / d1.unit(), d2 / d1.unit());
    // eprintln!("c1 = {:?}, d1 = {:?}, c2 = {:?}, d2 = {:?}", c1, d1, c2, d2);
    let p = if d2.unit().x.abs() < 1e-9 {
        C::new(c2.x, 0.0)
    } else {
        C::new(c2.x / d2.unit().x * d2.unit().y, 0.0)
    };
    Some(p * rotate + shift)
}

impl Add for C {
    type Output = Self;
    fn add(self, other: Self) -> Self {
        C {
            x: self.x + other.x,
            y: self.y + other.y,
        }
    }
}

impl Sub for C {
    type Output = Self;
    fn sub(self, other: Self) -> Self {
        C {
            x: self.x - other.x,
            y: self.y - other.y,
        }
    }
}

impl Mul for C {
    type Output = Self;
    fn mul(self, other: Self) -> Self {
        C {
            x: self.x * other.x - self.y * other.y,
            y: self.x * other.y + self.y * other.x,
        }
    }
}

impl Div for C {
    type Output = Self;
    fn div(self, other: Self) -> Self {
        // (a + bi) / (c + di) = (a + bi)(c - di) / (cc + dd)
        self * other.conj() / other.norm2()
    }
}

impl Div<f64> for C {
    type Output = Self;
    fn div(self, other: f64) -> Self {
        C {
            x: self.x / other,
            y: self.y / other,
        }
    }
}

fn main() {
    input! {
        n: usize,
        xs: [(i64,i64); n],
    }
    let mut ps = vec![];
    for &(x, y) in &xs {
        ps.push(C::new(x as f64, y as f64));
    }
    let mut res = 1e30;
    for i in 0..n {
        for j in i + 1..n {
            for k in j + 1..n {
                let (ij_c, ij_d) = vertical_bisector(ps[i], ps[j]);
                let (jk_c, jk_d) = vertical_bisector(ps[j], ps[k]);
                let p = cross((ij_c, ij_d), (jk_c, jk_d));
                if let Some(p) = p {
                    println!("{:?} {:?} {:?} -> {:?}", ps[i], ps[j], ps[k], p);
                    let mut t = 0.0;
                    for &q in &ps {
                        if t < (q - p).abs() {
                            t = (q - p).abs();
                        }
                    }
                    if res > t {
                        res = t;
                    }
                }
            }
        }
    }
    for i in 0..n {
        for j in i + 1..n {
            let p = (ps[i] + ps[j]) / 2.0;
            println!("{:?} {:?} -> {:?}", ps[i], ps[j], p);
            let mut t = 0.0;
            for &q in &ps {
                if t < (q - p).abs() {
                    t = (q - p).abs();
                }
            }
            if res > t {
                res = t;
            }
        }
    }
    println!("{:.20}", res);
}