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 C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>
#include <set>
using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;
ll BASE_NUM = 1000000007;

int solve_linear_equation(double a11, double a12, double a21, double a22, double b1, double b2, double &x1, double &x2)
{
    double det = a11 * a22 - a12 * a21;
    if (det == 0)
    {
        // cout << a11 << a12 << a21 << a22 << endl;
        return 0;
    }
    else
    {
        x1 = 1.0 * (a22 * b1 - a12 * b2) / det;
        x2 = 1.0 * (-a21 * b1 + a11 * b2) / det;
        return 1;
    }
}

double distance(pair<double,double> &p1,pair<double,double> &p2){
    double diff_x = p1.first - p2.first;
    double diff_y = p1.second - p2.second;
    return sqrt(diff_x * diff_x + diff_y * diff_y);
};
int main()
{
    // 整数の入力
    ll N;
    cin >> N;
    vector<pair<double, double>> points;
    for (int i = 0; i < N; i++)
    {
        double x, y;
        cin >> x >> y;
        points.push_back({x, y});
    }
    if (N == 2)
    {
        double center_x = (points[0].first + points[1].first) / 2;
        double center_y = (points[0].second + points[1].second) / 2;
        double diff_x = abs(points[0].first - center_x);
        double diff_y = abs(points[0].second - center_y);
        cout << fixed << setprecision(14) << sqrt(diff_x * diff_x + diff_y * diff_y) << endl;
    }
    else
    {
        double min_r = 10000;
        for (int i = 0; i < N; i++)
        {
            for (int j = i + 1; j < N; j++)
            {
                for (int k = j + 1; k < N; k++)
                {
                    double c_ij = points[i].first * points[i].first - points[j].first * points[j].first + points[i].second * points[i].second - points[j].second * points[j].second;
                    double c_ik = points[i].first * points[i].first - points[k].first * points[k].first + points[k].second * points[i].second - points[k].second * points[k].second;
                    c_ij = c_ij/2;
                    c_ik = c_ik/2;
                    double center_x, center_y;
                    solve_linear_equation(points[i].first - points[j].first, points[i].second - points[j].second,
                                          points[i].first - points[k].first, points[i].second - points[k].second,
                                          c_ij, c_ik, center_x, center_y);
                    pair<double,double> center{center_x,center_y};
                    double r = distance(center,points[i]);
                    // cout << center_x << center_y << endl;
                    // cout << r << endl;
                    bool is_all_contains = true;
                    for(auto p: points){
                        if (distance(center,p) > r){
                            is_all_contains = false;
                            break;
                        }
                    }

                    // cout << "---" << endl;
                    if(is_all_contains){
                        min_r = min(min_r,r);
                    }
                }
            }
        }
        cout << fixed << setprecision(14) <<min_r << endl;
    }
    return 0;
}