#include #include #include #include using namespace std; const double PI = 3.1415926535897932384626433832795; void doit(int x, int y, double radius) { int n; cin >> n; vector args; for (int i=0; i> xx >> yy; int dx = x - xx; int dy = y - yy; double d = sqrt(dx*dx + dy*dy); if (d > radius) continue; double arg = atan2(dy, dx); args.push_back(arg); args.push_back(arg + 2 * PI); } sort(args.begin(), args.end()); int max = 0; int j = 1; for (int i=0; i < args.size(); ++i) { double arg = args[i]; while (j < args.size() && args[j] <= arg + PI) ++j; int width = j - i; if (max < width) max = width; //if (j == args.size()) break; } cout << max << endl; } int main() { int x, y; double radius; while (1) { cin >> x >> y >> radius; if (radius < 0.0) break; doit(x, y, radius); } return 0; }