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(Debug, Clone, Copy)]
pub struct Point {
    x: f64,
    y: f64,
}

impl Point {
    pub fn new(x: f64, y: f64) -> Point {
        Point { x: x, y: y }
    }
    pub fn x(&self) -> f64 {
        self.x
    }
    pub fn y(&self) -> f64 {
        self.y
    }
    pub fn dist(p0: Point, p1: Point) -> f64 {
        let dx = p1.x() - p0.x();
        let dy = p1.y() - p0.y();
        (dx * dx + dy * dy).sqrt()
    }
    pub fn middle_point(p0: Point, p1: Point) -> Point {
        let x = (p0.x() + p1.x()) / 2.0;
        let y = (p0.y() + p1.y()) / 2.0;
        Point::new(x, y)
    }
}

pub struct Triangle {
    ps: [Point; 3],
}

impl Triangle {
    pub fn new(ps: [Point; 3]) -> Triangle {
        Triangle { ps: ps }
    }
    pub fn has_no_area(&self) -> bool {
        let dx1 = self.ps[1].x() - self.ps[0].x();
        let dy1 = self.ps[1].y() - self.ps[0].y();
        let dx2 = self.ps[2].x() - self.ps[1].x();
        let dy2 = self.ps[2].y() - self.ps[1].y();
        // dy1 / dx1 = dy2 / dx2
        (dy1 * dx2 - dy2 * dx1).abs() < 1e-9
    }
    pub fn outer_center(&self) -> Option<Point> {
        if self.has_no_area() {
            return None;
        }
        let xs = [self.ps[0].x(), self.ps[1].x(), self.ps[2].x()];
        let ys = [self.ps[0].y(), self.ps[1].y(), self.ps[2].y()];
        let a = -2.0 * (xs[0] - xs[1]);
        let b = -2.0 * (ys[0] - ys[1]);
        let c = xs[1] * xs[1] - xs[0] * xs[0] + ys[1] * ys[1] - ys[0] * ys[0];
        let d = -2.0 * (xs[2] - xs[1]);
        let e = -2.0 * (ys[2] - ys[1]);
        let f = xs[0] * xs[0] - xs[1] * xs[1] + ys[0] * ys[0] - ys[1] * ys[1];
        // ax + by = c
        // dx + ey = f
        let x = (c * e - b * f) / (a * e - b * d);
        let y = (a * f - c * d) / (a * e - b * d);
        Some(Point::new(x, y))
    }
}

fn main() {
    /*
    let mut rand = xorshift::XorShift128::new();
    loop {
        let mut xs = vec![];
        let n = 10;
        for i in 0..n {
            xs.push((rand.gen_mod(1001) as i64, rand.gen_mod(1001) as i64));
        }
        let res = f(n, xs);
        println!("res = {:?}", res);
    }
    */

    input! {
        n: usize,
        xs: [(i64,i64); n],
    }
    let res = f(n, xs);
    println!("{:.50}", res);
}

fn f(n: usize, xs: Vec<(i64, i64)>) -> f64 {
    let mut ps = vec![];
    for &(x, y) in &xs {
        ps.push(Point::new(x as f64, y as f64));
    }
    let mut res = 1e30;
    for i in 0..n {
        for j in 0..n {
            for k in 0..n {
                let triangle = Triangle::new([ps[i], ps[j], ps[k]]);
                if let Some(p) = triangle.outer_center() {
                    let mut t = 0.0;
                    for &q in &ps {
                        if t < Point::dist(p, q) {
                            t = Point::dist(p, q);
                        }
                    }
                    if res > t {
                        res = t;
                    }
                }
            }
        }
    }
    for i in 0..n {
        for j in 0..n {
            let p = Point::middle_point(ps[i], ps[j]);
            //// eprintln!("{:?} {:?} -> {:?}", ps[i], ps[j], p);
            let mut t = 0.0;
            for &q in &ps {
                if t < Point::dist(p, q) {
                    t = Point::dist(p, q);
                }
            }
            if res > t {
                res = t;
            }
        }
    }
    res
}