#include #include #include #include using namespace std; long long int N; long long int X[2000]; long long int Y[2000]; bool dp[2000]; bool dfs(int a, int b, long long int x) { // xcmのものさしでPaからPbまで行けるかな bool flag = false; if (a == b) { dp[a] = true; return true; } for (int i = 0; i < N; i++) { if (i == a) continue; if (!dp[i]) { if ((X[i] - X[a])*(X[i] - X[a]) + (Y[i] - Y[a])*(Y[i] - Y[a]) <= x*x) { dp[i] = true; flag = dfs(i, b, x); if (flag) break; } } } return flag; } bool C(long long int x) { // xcmのものさしでP1からPnまで行けるかな return dfs(0, N-1, x); } int main() { memset(X, 0, sizeof(X)); memset(Y, 0, sizeof(Y)); memset(dp, false, sizeof(dp)); cin >> N; for (int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; } long long int lb = 0; long long int ub = 2E9; long long int mid = 0; cout << C(10) << endl; memset(dp, false, sizeof(dp)); while (1) { mid = (((lb + ub) / 2) / 10) * 10; if (C(mid)) ub = mid; else lb = mid; if (ub == lb) break; else if (ub - lb == 10) { if (C(lb)) { ub = lb; break; } else { lb = ub; break; } } //cout << "u:" << ub << ",l:" << lb<< ",m:" << mid << endl; memset(dp, false , sizeof(dp)); } cout << ub << endl; return 0; }