#include using namespace std; struct dsu { public: dsu() : _n(0) {} dsu(int n) : _n(n), parent_or_size(n, -1) {} int merge(int a, int b) { assert(0 <= a && a < _n); assert(0 <= b && b < _n); int x = leader(a), y = leader(b); if (x == y) return x; if (-parent_or_size[x] < -parent_or_size[y]) std::swap(x, y); parent_or_size[x] += parent_or_size[y]; parent_or_size[y] = x; return x; } bool same(int a, int b) { assert(0 <= a && a < _n); assert(0 <= b && b < _n); return leader(a) == leader(b); } int leader(int a) { assert(0 <= a && a < _n); if (parent_or_size[a] < 0) return a; return parent_or_size[a] = leader(parent_or_size[a]); } int size(int a) { assert(0 <= a && a < _n); return -parent_or_size[leader(a)]; } std::vector> groups() { std::vector leader_buf(_n), group_size(_n); for (int i = 0; i < _n; i++) { leader_buf[i] = leader(i); group_size[leader_buf[i]]++; } std::vector> result(_n); for (int i = 0; i < _n; i++) { result[i].reserve(group_size[i]); } for (int i = 0; i < _n; i++) { result[leader_buf[i]].push_back(i); } result.erase( std::remove_if(result.begin(), result.end(), [&](const std::vector& v) { return v.empty(); }), result.end()); return result; } private: int _n; // root node: -1 * component size // otherwise: parent std::vector parent_or_size; }; vector> Totsuho(vector> &pos){ int n=pos.size(),n1,n2; sort(pos.begin(),pos.end()); vector> res1={pos[0],pos[1]},res2={pos[0],pos[1]}; auto cross=[&](pair a,pair b){ return (long long)a.first*b.second-(long long)a.second*b.first; }; auto sub=[&](pair a,pair b){ return make_pair(a.first-b.first,a.second-b.second); }; for(int i=2;i=2&&cross(sub(res1[n1-1],res1[n1-2]),sub(pos[i],res1[n1-1]))<=0){ res1.pop_back(); n1--; } while(n2>=2&&cross(sub(res2[n2-1],res2[n2-2]),sub(pos[i],res2[n2-1]))>=0){ res2.pop_back(); n2--; } res1.push_back(pos[i]); res2.push_back(pos[i]); } for (int i=res2.size()-2;i>=1;i--)res1.push_back(res2[i]); return res1; } double Calipers(vector> &tot){ int n = tot.size(); auto dist = [&](int i, int j){ long long dy = tot[i].first - tot[j].first; long long dx = tot[i].second - tot[j].second; return dy * dy + dx * dx; }; auto cross=[&](pair a,pair b){ return (long long)a.first*b.second-(long long)a.second*b.first; }; auto sub=[&](pair a,pair b){ return make_pair(a.first-b.first,a.second-b.second); }; if(n == 1){ return 0; } if(n == 2){ return sqrt(dist(0, 1)); } double ans = 0; int i = 0, j = 0; for(int k = 0; k < n; k++){ if(tot[k].first < tot[i].first)i = k; if(tot[k].first > tot[j].first)j = k; } int si = i, sj = j; int cnt = 0; while(i != sj || j != sj){ cnt ++; ans = max(ans, sqrt(dist(i, j))); int i2 = i + 1 == n ? 0 : i + 1, j2 = j + 1 == n ? 0 : j + 1; if(cross(sub(tot[i2],tot[i]),sub(tot[j2],tot[j])) < 0){ i = i2; }else{ j = j2; } if(cnt >= 2*n)break; } return ans; } int main(){ int n, y, x; cin >> n; vector> a(n); for(int i = 0; i < n; i++){ cin >> a[i].first >> a[i].second; } sort(a.begin(), a.end()); dsu uf(n); for(int i = 0; i < n; i++){ tie(y, x) = a[i]; for(int dy = -10; dy <= 10; dy++){ for(int dx = -10; dx <= 10; dx++){ if(dy * dy + dx * dx > 100)continue; auto p = make_pair(y + dy, x + dx); int j = lower_bound(a.begin(), a.end(), p) - a.begin(); if(j < n && a[j] == p){ uf.merge(i, j); } } } } double ans = 1 + (n != 0); auto G = uf.groups(); for(auto &&b:G){ if(b.size() == 1)continue; vector> c; for(auto i:b)c.push_back(a[i]); auto tot = Totsuho(c); ans = max(ans, 2 + Calipers(tot)); } printf("%.15lf\n",ans); }