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();
                }
            }
        }
    }
}

mod gcd {
    use std;

    pub fn gcd<T>(x: T, y: T) -> T
    where
        T: PartialEq + Copy + std::ops::Rem<Output = T> + std::convert::From<u8>,
    {
        if y == T::from(0u8) {
            x
        } else {
            gcd(y, x % y)
        }
    }
}

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

use gcd::*;
use std::convert::*;
use std::ops::*;

#[derive(Debug, Clone, Copy)]
pub struct Rational {
    a: i64,
    b: i64,
}

impl Rational {
    pub fn new(a: i64, b: i64) -> Rational {
        Rational { a: a, b: b }
    }
}

impl From<Rational> for f64 {
    fn from(x: Rational) -> f64 {
        x.a as f64 / x.b as f64
    }
}

impl From<i64> for Rational {
    fn from(x: i64) -> Rational {
        Rational { a: x, b: 1 }
    }
}

impl Add for Rational {
    type Output = Rational;
    fn add(self, other: Rational) -> Rational {
        let a = self.a * other.b + other.a * self.b;
        let b = self.b * other.b;
        let c = gcd(a, b);
        Rational { a: a / c, b: b / c }
    }
}

impl Sub for Rational {
    type Output = Rational;
    fn sub(self, other: Rational) -> Rational {
        let a = self.a * other.b - other.a * self.b;
        let b = self.b * other.b;
        let c = gcd(a, b);
        Rational { a: a / c, b: b / c }
    }
}

impl Mul for Rational {
    type Output = Rational;
    fn mul(self, other: Rational) -> Rational {
        let a = self.a * other.a;
        let b = self.b * other.b;
        let c = gcd(a, b);
        Rational { a: a / c, b: b / c }
    }
}

impl Div for Rational {
    type Output = Rational;
    fn div(self, other: Rational) -> Rational {
        let a = self.a * other.b;
        let b = self.b * other.a;
        let c = gcd(a, b);
        Rational { a: a / c, b: b / c }
    }
}

#[derive(Debug, Clone, Copy)]
pub struct Point<T> {
    x: T,
    y: T,
}

impl<
        T: Clone
            + Copy
            + From<i64>
            + Add<Output = T>
            + Sub<Output = T>
            + Mul<Output = T>
            + Div<Output = T>
            + Into<f64>,
    > Point<T>
{
    pub fn new(x: T, y: T) -> Point<T> {
        Point { x: x, y: y }
    }
    pub fn x(&self) -> T {
        self.x
    }
    pub fn y(&self) -> T {
        self.y
    }
    pub fn dist(p0: Point<T>, p1: Point<T>) -> f64 {
        let dx = p1.x() - p0.x();
        let dy = p1.y() - p0.y();
        (dx * dx + dy * dy).into().sqrt()
    }
    pub fn middle_point(p0: Point<T>, p1: Point<T>) -> Point<T> {
        let x = (p0.x() + p1.x()) / T::from(2);
        let y = (p0.y() + p1.y()) / T::from(2);
        Point::new(x, y)
    }
}

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

impl<
        T: Clone
            + Copy
            + From<i64>
            + Add<Output = T>
            + Sub<Output = T>
            + Mul<Output = T>
            + Div<Output = T>
            + Into<f64>,
    > Triangle<T>
{
    pub fn new(ps: [Point<T>; 3]) -> Triangle<T> {
        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).into().abs() < 1e-10
    }
    pub fn outer_center(&self) -> Option<Point<T>> {
        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 = T::from(-2) * (xs[0] - xs[1]);
        let b = T::from(-2) * (ys[0] - ys[1]);
        let c = xs[1] * xs[1] - xs[0] * xs[0] + ys[1] * ys[1] - ys[0] * ys[0];
        let d = T::from(-2) * (xs[2] - xs[1]);
        let e = T::from(-2) * (ys[2] - ys[1]);
        let f = xs[2] * xs[2] - xs[1] * xs[1] + ys[2] * ys[2] - ys[1] * ys[1];
        // // eprintln!("{:?} {:?} {} {} {} {}", a, b, c, d, e, f);
        // 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::<Rational>::new(Rational::from(x), Rational::from(y)));
    }
    let mut res = 1e30;
    for i in 0..n {
        for j in i + 1..n {
            for k in j + 1..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 i + 1..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
}