#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class UnionFindTree { private: int N; int *rootnum; int *rank; int *unionnum; public: UnionFindTree(int n){ /*0からn-1までの要素をunionとしてもつ*/ N = n; rootnum = new int[N]; rank = new int[N]; unionnum = new int[N]; for( int i = 0 ; i < N ; i++ ){ rootnum[i] = i; rank[i] = 0; unionnum[i] = 1; } } int Find( int j ){ if( rootnum[j] == j ){ return j; } else{ return rootnum[j] = Find(rootnum[j]); } } void Union( int i , int j ){ int x = Find(i); int y = Find(j); if( x == y ) return; N--; if( rank[x] < rank[y] ){ rootnum[y] = x; unionnum[x] += unionnum[y]; }else{ rootnum[x] = y; unionnum[y] += unionnum[x]; if( rank[x]==rank[y] ) rank[x]++; } } int Num( int j ){ /*与えられた要素の入っている集合の要素数を答える*/ int x = Find(j); return unionnum[x]; } int UnionNum(){ /*集合の数を答える*/ return N; } ~UnionFindTree(){ delete rootnum; delete rank; delete unionnum; } }; long long product( pair p1, pair p2, pair p3 ){ pair v1 = make_pair( p2.first-p1.first, p2.second-p1.second); pair v2 = make_pair( p3.first-p2.first, p3.second-p2.second); return -(v2.first*(long long)v1.second-v2.second*(long long)v1.first); } vector< pair > convex_hull( vector > &V){ if( V.size() <=2 ) return V; int size = V.size(); sort(V.begin(),V.end()); vector > ret(size*2); int retlen=0; for( int i = 0 ; i = 2 && product( ret[retlen-2],ret[retlen-1],V[i] ) <= 0 ) retlen--; ret[retlen++]=V[i]; } int underlen=retlen; for( int i = size-2 ; i >= 0 ; i-- ){ while( retlen > underlen && product( ret[retlen-2],ret[retlen-1],V[i] ) <= 0 ) retlen--; ret[retlen++]=V[i]; } ret.resize(retlen); return ret; } pair points[120001]; vector< pair > V[120001]; map m[20011]; UnionFindTree uft(120001); int main(){ int N; cin >> N; for( int i = 0 ; i < N ; i++ ){ V[i].clear(); cin >> points[i].first >> points[i].second; m[points[i].first+10000][points[i].second+10000]=i+1; } if( N == 0 ){ printf("%.10f\n",1.0); return 0; } for( int i = 0 ; i < N ; i++ ){ int x = points[i].first+10000; int y = points[i].second+10000; for( int x2 = x ; x2 <= x+10; x2++ ){ map::iterator it=m[x2].lower_bound(y-10); map::iterator itEnd=m[x2].lower_bound(y+11); for( ;it != itEnd; it++ ){ int y2=it->first; int dx=x-x2; int dy=y-y2; if( dx*dx+dy*dy <= 100 ){ //cout << i <<" "<< it->second-1<second-1); } } } } for( int i = 0 ; i < N ; i++ ){ V[uft.Find(i)].push_back(points[i]); } long long maxDist = 0; for( int i = 0 ; i > convPoints = convex_hull(V[i]); for( int j = 0 ; j < (int) convPoints.size(); j ++ ){ // cout << convPoints[j].first << "," << convPoints[j].second<<"/ "; for( int k = j+1 ; k < (int) convPoints.size(); k++ ){ long long dx = convPoints[j].first-convPoints[k].first; long long dy = convPoints[j].second-convPoints[k].second; maxDist = max(maxDist,dx*dx+dy*dy); } } // cout << endl; } printf("%.10f\n",2.0+sqrt((double)maxDist)); return 0; }