#include #include using namespace std; using namespace atcoder; int main() { int N; cin >> N; map, vector>> XY; vector X, Y; for (int n = 0; n < N; ++n) { int x, y; cin >> x >> y; XY[{x / 10, y / 10}].push_back({x, y, n}); X.push_back(x); Y.push_back(y); } dsu UF(N); for (auto& [ij, lst] : XY) { int i=ij.first; int j=ij.second; for (int di = -1; di <= 1; ++di) { for (int dj = -1; dj <= 1; ++dj) { if (!XY.count({i + di, j + dj})) { continue; } for (auto& [x, y, n] : XY[{}]) { for (auto& [xx, yy, nn] : XY[{i + di, j + dj}]) { if ((x - xx) * (x - xx) + (y - yy) * (y - yy) <= 100) { UF.merge(n, nn); } } } } } } double ans = 1; for (auto& lst : UF.groups()) { for (int i : lst) { for (int j : lst) { ans = max(ans, sqrt((X[i] - X[j]) * (X[i] - X[j]) + (Y[i] - Y[j]) * (Y[i] - Y[j])) + 2); } } } cout << ans << endl; return 0; }