#include using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) pair> from_pt(int p, int q, int A, int B, int r) { double ba = (1.0) * B / A; double qa = ba * ba + 1; double qb = - (2 * p + 2 * ba * q); double qc = p * p + q * q - r*r; double discr = qb * qb - 4 * qa * qc; if (discr < 0) { return {false, {0, 0}}; } else{ double a = -qb / (2 * qa); double b = 1 / (2 * qa); double s = discr; double x0 = a - b * sqrt(s) - 0.000001; double x1 = a + b * sqrt(s) + 0.000001; return {true, {x0, x1}}; } } int main(void){ ios_base::sync_with_stdio(false); int n, r, a, b; cin >> n >> r >> a >> b; vector> pts; vector> edges; bool swap = false; if (a == 0) { swap = true; a = b; b = 0; } rep(i, n) { int x, y; cin >> x >> y; if (swap) { int backup = x; x = y; y = backup; } auto res = from_pt(x, y, a, b, r); if (res.first) { auto xs = res.second; edges.push_back({xs.first, true}); edges.push_back({xs.second, false}); } } sort(edges.begin(), edges.end()); int maxcount = 0; int curcount = 0; rep(i, edges.size()) { auto e = edges[i]; if (e.second) { curcount += 1; maxcount = max(maxcount, curcount); } else { curcount -= 1; } } cout << maxcount << endl; return 0; }