#include using namespace std; #define VI vector #define PII pair #define VPI vector #define mp make_pair #define eb emplace_back #define pb push_back #define st first #define nd second #define endl '\n' #define debug(x) cerr << #x << " " << x << endl; #define ll long long #define int ll #define ld long double const int N = 1e6 + 7; vector pocz, kon, pkt; ld pole(ld a, ld b, ld x, ld y) { return fabs(x * b - y * a); } ld dist(ld a, ld b, ld x, ld y) { return pole(a, b, x, y) / sqrtl(a * a + b * b); } void solve(){ int n, R, a, b; cin >> n >> R >> a >> b; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; if (dist(a, b, x, y) <= R) { ld r = sqrtl(R * R - dist(a, b, x, y) * dist(a, b, x, y)); ld d2 = x * x + y * y; ld h = pole(a, b, x, y) / sqrtl(a * a + b * b); ld s = sqrtl(d2 - h * h); pocz.pb(s - r); kon.pb(s + r); pkt.pb(s - r); pkt.pb(s + r); } } sort(pkt.begin(), pkt.end()); sort(pocz.begin(), pocz.end()); sort(kon.begin(), kon.end()); int pozpocz = 0, pozkon = 0; int wynik = 0; int res = 0; for (ld pt : pkt) { while(pozpocz < pocz.size() && pocz[pozpocz] <= pt) wynik++, pozpocz++; res = max(res, wynik); while(pozkon < kon.size() && kon[pozkon] <= pt) wynik--, pozkon++; } /*for (auto it : pocz) { cout << it << " "; } cout << "\n";*/ cout << res << "\n"; } int32_t main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int test = 1; while(test--){ solve(); } return 0; }