#include "bits/stdc++.h" using namespace std; typedef complex P; namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } } #define EPS 1e-8 struct C { P p; double r; C(const P &p, double r) : p(p), r(r) { } }; bool xy_less(const P& a, const P& b) { if (abs(a.imag() - b.imag()) < EPS) return (a.real() < b.real()); return (a.imag() < b.imag()); } double ccw(P a, P b, P c) { return (conj(b - a)*(c - a)).imag(); } template void walk_rightside(IN begin, IN end, vector

& v) { IN cur = begin; v.push_back(*cur++); vector

::size_type s = v.size(); v.push_back(*cur++); while (cur != end) { if (v.size() == s || ccw(v[v.size() - 2], v.back(), *cur) > EPS) v.push_back(*cur++); else v.pop_back(); } v.pop_back(); } vector

convex_hull(vector

v) { if (v.size() <= 1) return v; // EXCEPTIONAL sort(v.begin(), v.end(), xy_less); vector

cv; walk_rightside(v.begin(), v.end(), cv); walk_rightside(v.rbegin(), v.rend(), cv); return cv; } vector box[2004][2004]; vector

p2[130002]; int unidp[130002]; int findunidp(int a){ if (unidp[a] < 0) return a; else return unidp[a] = findunidp(unidp[a]); } bool connect(int a, int b){ a = findunidp(a); b = findunidp(b); if (a == b) return false; unidp[a] += unidp[b]; unidp[b] = a; return true; } int main(){ int N; cin >> N; vector

ps; for (int i = 0; i < N; i++) { int X, Y; cin >> X >> Y; ps.push_back(P(X + 10000, Y + 10000)); unidp[i] = -1; } if (N == 0){ cout << 1 << endl; return 0; } for (int i = 0; i < N; i++) { int Xb = (int)(ps[i].real()) / 10 + 1; int Yb = (int)(ps[i].imag()) / 10 + 1; for (int dy = -1; dy <= 1; dy++) { for (int dx = -1; dx <= 1; dx++) { int nXb = Xb + dx; int nYb = Yb + dy; for (int j : box[nXb][nYb]) { if (abs(ps[i] - ps[j]) <= 10){ connect(i, j); } } } } box[Xb][Yb].push_back(i); } for (int i = 0; i < N; i++) { p2[findunidp(i)].push_back(ps[i]); } double ans = 0; for (int i = 0; i < N; i++) { if (p2[i].size() < 2) continue; vector

p3 = convex_hull(p2[i]); int M = p3.size(); int p = 0; int q = 0; vector dist(M, 0); for (int j = 0; j < M; j++) { while (true){ q = p + 1; q %= M; double d1 = abs(p3[j] - p3[p]); double d2 = abs(p3[j] - p3[q]); ans = max(ans, d2); dist[j] = max(dist[j], d1); if (d1 >= d2) break; p = q; } /* while (true){ int k = j - 1; if (k < 0){ break; } double d = abs(p3[k] - p3[p]); if (dist[k] < d){ dist[k] = d; j = k; } else break; } */ } } ans += 2; printf("%.14f\n", ans); }