#include #include #include #include #include #include #include #include using namespace std; #define ERROR 1e-10 #define cmp_t complex #define re real() #define im imag() bool operator<(const cmp_t& a,const cmp_t& b) { return a.re < b.re-ERROR || (a.re < b.re+ERROR && a.im < b.im-ERROR); } bool GetCircleCrossPoint(cmp_t& a1,cmp_t& a2, cmp_t o1,double r1,cmp_t o2,double r2) { // I'm Sorry but we can't go public. This is our private library. } int Count(cmp_t o,vector& points) { int ans = 0; vector::iterator p = upper_bound(points.begin(),points.end(),cmp_t(o.re-1-ERROR,0)); vector::iterator q = lower_bound(points.begin(),points.end(),cmp_t(o.re+1+ERROR,0)); while(p <= q) { if(abs(*p - o) < 1+ERROR)ans++; p++; } return ans; } int Solve(vector& points) { int ans = 1,n=points.size(); sort(points.begin(),points.end()); for(int i = 0 ; i < n ; i++) for(int j = i+1 ; j < n ; j++) if(points[i].re+2 > points[j].re+ERROR) { cmp_t p1,p2; if(GetCircleCrossPoint(p1,p2,points[i],1,points[j],1)) { ans = max(ans,max(Count(p1,points),Count(p2,points))); } } return ans; } int main() { int n; while(cin >> n , n) { double x,y; vector points; while(n--) { cin >> x >> y; points.push_back(cmp_t(x,y)); } cout << Solve(points) << endl; } return 0; }