#include #define st first #define nd second #define pb push_back #define rep(i, a, b) for(int i = (a); i < (b); ++i) #define sci(x) int x; cin >> x; #define scvi(v, n) vector v(n); rep(i, 0, n) cin >> v[i]; using namespace std; typedef long long ll; typedef pair ii; typedef vector vi; typedef long double ld; const int duzo = 356782; const ld eps = 1e-9; int N; ld R, A, B; int RR, AA, BB; pair punkty[duzo]; bool otw[duzo]; struct zdarz { int pukt, rodz; ld xx, yy; }; vector Z; inline ld kw(ld x) { return x * x; } inline void zrob_pukt(int i) { ld z = punkty[i].st; ld t = punkty[i].nd; if(AA == 0) { ld pomoc = kw(R) - kw(z); if(pomoc < 0.0) return; ld y1 = t + sqrt(pomoc); ld y2 = t - sqrt(pomoc); Z.pb({i, 1, 0.0, y1}); Z.pb({i, -1, 0.0, y2}); } else { ld WA = 1.0 + kw(B / A); ld WB = -2.0 * (z + t * (B / A)); ld WC = kw(z) + kw(t) - kw(R); ld delta = kw(WB) - 4.0 * WA * WC; if(delta < 0.0) return; delta = sqrt(delta); ld x1 = (-WB + delta) / (2.0 * WA); ld x2 = (-WB - delta) / (2.0 * WA); ld y1 = (B / A) * x1; ld y2 = (B / A) * x2; //cerr << i << " " << delta << endl; int r1 = -1, r2 = 1; if(x1 > x2) swap(r1, r2); Z.pb({i, r1, x1, y1}); Z.pb({i, r2, x2, y2}); } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> N >> RR >> AA >> BB; A = AA; B = BB; R = RR; for(int i = 1; i <= N; ++i){ int x, y; cin >> x >> y; punkty[i] = {x, y}; } for(int i = 1; i <= N; ++i) { zrob_pukt(i); } sort(Z.begin(), Z.end(), [&](zdarz& a, zdarz& b) { if(AA == 0) { if(abs(a.yy - b.yy) < eps) return a.rodz < b.rodz; return a.yy < b.yy; } if(abs(a.xx - b.xx) < eps) return a.rodz < b.rodz; return a.xx < b.xx; }); int ile = 0; int gz = 0; for(auto z: Z) { //cerr << z.pukt << " " << z.xx << " " << z.yy << endl; if(otw[z.pukt]) --ile; else ++ile; gz = max(gz, ile); otw[z.pukt] = !(otw[z.pukt]); } cout << gz; return 0; }