#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--) #define FOREACH(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++) #define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end()) #define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end()) #define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end()) #define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val)) #define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val)) #define EPS 1.0e-8 #define MOD 1000000007 typedef long long ll; struct Point { double x,y; Point(){} Point(double _x, double _y):x(_x),y(_y){} bool operator < (const Point &a) const { return (x==a.x) ? (y Polygon; double dot(Vector a, Vector b){return a.x*b.x + a.y*b.y;} double cross(Vector a, Vector b){return a.x*b.y - a.y*b.x;} double norm(Vector a){return sqrt(dot(a,a)*dot(a,a));} Point Project(Segment s, Point p) { Vector base = s.p2 - s.p1; double r = dot(p - s.p1, base) / norm(base); return s.p1 + base * r; } Point Reflect(Segment s, Point p) { return p + (Project(s,p) - p) * 2.0; } double DistanceLinePoint(Line s, Point p) { Vector dist = Project(s,p) - p; return sqrt(norm(dist)); } double DistanceSegmentPoint(Segment s, Point p) { if(dot(s.p2 - s.p1, p -s.p1)<0.0)return sqrt(norm(p - s.p1)); if(dot(s.p1 - s.p2, p -s.p2)<0.0)return sqrt(norm(p - s.p2)); return DistanceLinePoint(s,p); } const int COUNTER_CLOCKWISE = 1; const int CLOCKWISE = -1; const int ONLINE_BACK = 2; const int ONLINE_FRONT = -2; const int ON_SEGMENT = 0; int CounterClockwise(Point p0, Point p1, Point p2) { Vector a = p1 - p0; Vector b = p2 - p0; if(cross(a,b)>1.0e-8)return COUNTER_CLOCKWISE; if(cross(a,b)<-1.0e-8)return CLOCKWISE; if(dot(a,b)<-1.0e-8)return ONLINE_BACK; if(norm(a) pos) { int n = (int)pos.size(), k = 0; sort(pos.begin(),pos.end()); Polygon ch(2*n); for(int i=0;i=2 && CounterClockwise(ch[k-2],ch[k-1],pos[i])<=0)--k; for(int i=n-2,t=k+1;i>=0;ch[k++]=pos[i--]) while(k>=t && CounterClockwise(ch[k-2],ch[k-1],pos[i])<=0)--k; ch.resize(k-1); return ch; } double ConvexDiameter(Polygon &pos) { int n = (int)pos.size(); int is = 0, js = 0; for(int i=1;i pos[is].y) is = i; if (pos[i].y < pos[js].y) js = i; } double maxd = norm(pos[is]-pos[js]); int i, maxi, j, maxj; i = maxi = is; j = maxj = js; do{ if(cross(pos[(i+1)%n]-pos[i],pos[(j+1)%n]-pos[j])>=0)j=(j+1)%n; else i=(i+1)%n; if(norm(pos[i]-pos[j]) > maxd) { maxd = norm(pos[i]-pos[j]); maxi = i; maxj = j; } }while(i!=is || j!=js); return sqrt(maxd); } class UnionFind { vector data; public: UnionFind(int size) : data(size, -1) { } bool unionSet(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return x != y; } bool findSet(int x, int y) { return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } int size(int x) { return -data[root(x)]; } }; int main(){ int N; cin>>N; vector p(N); REP(i,N)cin>>p[i].x>>p[i].y; map v; REP(i,N)v[p[i]]=i; UnionFind inst(120010); REP(kai,N){ for(double i=-10.0;i<=10.0;i+=1.0){ for(double j=-10.0;j<=10.0;j+=1.0){ Point pt(p[kai].x+i,p[kai].y+j); if(sqrt(i*i+j*j)+EPS<=10.0){ if(v.find(pt)!=v.end()){ inst.unionSet(v[pt],v[p[kai]]); } } } } } map> forest; REP(i,p.size())forest[inst.root(v[p[i]])].push_back(v[p[i]]); double ans = 0; FOREACH(kai,forest){ vector f = kai->second; vector pol(f.size()); REP(i,f.size())pol[i]=p[f[i]]; if(pol.size()==2){ Vector vt = pol[0] - pol[1]; ans = max(sqrt(norm(vt)),ans); }else if(pol.size()>=3){ Polygon pt = ConvexHull(pol); ans = max(ans,ConvexDiameter(pt)); } } cout<