/** * Circle and Points (PKU 1981) * by Kenji Inoue, 2007-01-05 **/ #include #include #include using namespace std; typedef complex P; #define EPS (1e-6) double R2 = sqrt(2.0); int n; P p[300]; struct box { double x, y, size; int cnt; bool operator<(const box &a) const { return (cnt < a.cnt); } }; priority_queue pq; int ans; void push(double x, double y, double size) { box b = {x, y, size, 0}; int cnt = 0; P c = P(x + size/2.0, y + size/2.0); // center point //double er = R2*size + 1.0; // radius of external circle double er = (R2*size + 1.0) * (R2*size + 1.0); for (int i=0; i ans) { ans = cnt; } if (b.cnt > ans) { pq.push(b); } } int main() { while (cin >> n, n) { for (int i=0; i> p[i].real() >> p[i].imag(); } // while (!pq.empty()) { pq.pop(); } box first = {0.0, 0.0, 10.0, n}; pq.push(first); ans = 1; while (!pq.empty()) { box b = pq.top(); pq.pop(); if (b.cnt > ans) { double half = b.size / 2.0; push(b.x, b.y, half); push(b.x+half, b.y, half); push(b.x, b.y+half, half); push(b.x+half, b.y+half, half); } } cout << ans << endl; } return 0; }