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 (Clang 3.8.0) (judge verdict: Wrong Answer)

#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;

    vector <double> x(n), y(n);
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

    double ans = 1000;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            double x_mid = (x[i] + x[j]) / 2.0;
            double y_mid = (y[i] + y[j]) / 2.0;

            double x_vec = - (y[i] - y_mid);
            double y_vec = - (x[i] - x_mid);

            double lx = x_mid + 1e10 * x_vec;
            double rx = x_mid - 1e10 * x_vec;
            double ly = y_mid + 1e10 * y_vec;
            double ry = y_mid - 1e10 * y_vec;

            for (int l = 0; l < 20; l++) {
                double x_mid = (lx + rx) / 2.0;
                double y_mid = (ly + ry) / 2.0;

                double mx = 0;
                double idx;
                for (int k = 0; k < n; k++) {
                    if (mx < (x_mid - x[k]) * (x_mid - x[k]) + (y_mid - y[k]) * (y_mid - y[k])) {
                        mx = (x_mid - x[k]) * (x_mid - x[k]) + (y_mid - y[k]) * (y_mid - y[k]);
                        idx = k;
                    }
                }

                double diff_l = (x[idx] - lx) * (x[idx] - lx) + (y[idx] - ly) * (y[idx] - ly);
                double diff_r = (x[idx] - rx) * (x[idx] - rx) + (y[idx] - ry) * (y[idx] - ry);

                if (diff_l > diff_r) {
                    lx = x_mid;
                    ly = y_mid;
                } else {
                    rx = x_mid;
                    ry = y_mid;
                }
            }

            double mx = 0;
            for (int k = 0; k < n; k++) {
                if (mx < (x_mid - x[k]) * (x_mid - x[k]) + (y_mid - y[k]) * (y_mid - y[k])) {
                    mx = (x_mid - x[k]) * (x_mid - x[k]) + (y_mid - y[k]) * (y_mid - y[k]);
                }
            }

            ans = min(ans, mx);
        }
    }

    cout << fixed << setprecision(10) << sqrt(ans) << "\n";
    return 0;
}