#include #include #include #include #include using namespace std; int n; vector x, y; vector visited; vector connectedNodes; int getNorm(int node1, int node2) { return (x[node1] - x[node2]) * (x[node1] - x[node2]) + (y[node1] - y[node2]) * (y[node1] - y[node2]); } void findConnectedNodes(int node) { if (visited[node]) { return; } visited[node] = true; connectedNodes.push_back(node); for (int i = 0; i < n; ++i) { if (node != i) { if (getNorm(i, node) <= 10 * 10) { findConnectedNodes(i); } } } } int main() { cin >> n; x.resize(n); y.resize(n); for (int i = 0; i < n; ++i) { cin >> x[i] >> y[i]; } visited.resize(n); double maxDistance = 0; if (n > 0) { for (int i = 0; i < n; ++i) { connectedNodes.clear(); if (visited[i]) { continue; } connectedNodes.push_back(i); findConnectedNodes(i); double distance; if (connectedNodes.size() > 1) { int maxNorm = 0; pair maxNormNodes; for (size_t k = 0; k < connectedNodes.size(); ++k) { for (size_t m = k + 1; m < connectedNodes.size(); ++m) { int node1 = connectedNodes[k]; int node2 = connectedNodes[m]; int norm = getNorm(node1, node2); if (maxNorm < norm) { maxNorm = norm; maxNormNodes = make_pair(node1, node2); } } } distance = sqrt(getNorm(maxNormNodes.first, maxNormNodes.second)); distance += 2.0; } else { distance = 2.0; } maxDistance = max(maxDistance, distance); } } else { maxDistance = 1.0; } cout << fixed << setprecision(12) << maxDistance << endl; return 0; }