#include using namespace std; enum Direction {In, Out, Kamu}; int main() { cin.sync_with_stdio(false); cin.tie(nullptr); int N; int XX0, YY0; long long RR0; cin >> N >> RR0 >> XX0 >> YY0; if (XX0 == 0 && YY0 == 0) { int s = 0; for (int i = 0; i < N; i++) { long long x,y; cin >> x >> y; if (x*x + y*y <= RR0*RR0) { s++; } } cout << s << endl; return 0; } double R,X0,Y0; R = RR0; X0 = XX0; Y0 = YY0; R += 0.0005; // 5*10^-4 double RR = R*R; typedef pair val; vector T; T.push_back({0.5, Kamu}); for (int i = 0; i < N; i++) { double x,y; cin >> x >> y; double a,b,c; a = X0*X0+Y0*Y0; // a > 0 b = -2*X0*x - 2*Y0*y; c = x*x+y*y - RR; double disc = b*b-4*a*c; if (disc < 0) continue; double nagy = (-b + sqrt(disc)) / 2*a; double kicsi = (-b - sqrt(disc)) / 2*a; T.push_back({kicsi, In}); T.push_back({nagy, Out}); } sort(T.begin(), T.end(), [](const val& a, const val& b) { return a.first < b.first; }); int s = 0, m = 0; for (const val& t: T) { if (t.first >= 0.0 && t.first <= 1.0) { if (m < s) m = s; } if (t.second == In) s++; else if (t.second == Out) s--; if (t.first >= 0.0 && t.first <= 1.0) { if (m < s) m = s; } } cout << m << endl; return 0; }