#include #include #include #include using namespace std; #define NPOINT_MAX 300 #define M_PI (2*acos(0.0)) #define EPS 0.0001 #define deq(a, b) ( fabs((a)-(b)) < EPS ) #define dle(a, b) ( (a) < (b) || deq(a, b) ) class Point { public: double x, y; Point() {} Point( double x, double y ) : x(x), y(y) {} double distance( const Point &p ) const { return sqrt((p.x-x)*(p.x-x) + (p.y-y)*(p.y-y)); } void rotate( const Point &o, const double rad ) { const double dx = x - o.x, dy = y - o.y; x = dx*cos(rad) - dy*sin(rad) + o.x; y = dx*sin(rad) + dy*cos(rad) + o.y; } }; int npoint; Point P[NPOINT_MAX]; int countIn( const Point &c ) { int result = 0; for ( int i = 0; i < npoint; i++ ) if ( dle(c.distance(P[i]), 1.0) ) result++; return result; } int compute( const Point &p, const Point &q ) { const double D = p.distance(q); if ( D > 2 ) return 0; double dx = q.x - p.x; double dy = q.y - p.y; dx /= D; dy /= D; Point c(p.x+dx, p.y+dy); const double A = acos((2 - D*D) / 2); c.rotate(p, (M_PI-A)/2); return countIn(c); } int main() { while ( true ) { cin >> npoint; if ( npoint == 0 ) break; for ( int i = 0; i < npoint; i++ ) cin >> P[i].x >> P[i].y; int maxPoint = 1; for ( int i = 0; i < npoint; i++ ) for ( int j = 0; j < npoint; j++ ) if ( i != j ) maxPoint = max(maxPoint, compute(P[i], P[j])); cout << maxPoint << endl; } return 0; }