#include <bits/stdc++.h>

using namespace std;

const int inf = 0x3f3f3f3f;
const int N = 100010;
struct node {
    double x, y;

    bool operator < (const node& t) const {
        if (x != t.x) return x < t.x;
        return y < t.y;
    }
}p[N];

double dis(double a, double b, double x, double y) {
    return sqrt((a - x) * (a - x) + (b - y) * (b - y));
}

bool cmp(node a, node b) {
    return a.y < b.y;
}

double solve(int l, int r) {
    int d = inf;
    if (l == r) return d;
    if (l + 1 == r) return dis(p[l].x, p[l].y, p[r].x, p[r].y);
    int mid = l + r >> 1;
    double d1 = solve(l, mid);
    double d2 = solve(mid + 1, r);
    d1 = min(d1, d2);
    vector<node> v;
    for (int i = l; i <= r; i++) {
        if (abs(p[i].x - p[mid].x) <= d1) {
            v.push_back(p[i]);
        }
    }
    sort(v.begin(), v.end(), cmp);
    for (int i = 0; i < v.size(); i++) {
        for (int j = i + 1; j < v.size() && (v[j].y - v[i].y) <= d1; j++)
            d1 = min(d1, dis(v[i].x, v[i].y, v[j].x, v[j].y));
    }
    return d1;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int n;
    while (scanf("%d", &n)) {
        if (n == 0) 
            break;
        for (int i = 1; i <= n; i++) scanf("%lf%lf", &p[i].x, &p[i].y);
        sort(p + 1, p + n + 1);
        double ans = solve(1, n);
        printf("%.2f\n", ans / 2);
    }

    return 0;
}
最后修改:2020 年 12 月 10 日 08 : 51 PM