#include using namespace std; #define double long double vector > v; vector > prz; double eps = 0.000001; double a, b; double dist(double x, double y, double x2, double y2) { return (x - x2) * (x - x2) + (y - y2) * (y - y2); } struct moj { double kiedy; int ile; bool operator<(const moj &other) const { return kiedy < other.kiedy; } }; vector tab; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, r; int aa, bb; cin >> n >> r >> aa >> bb; double ma = max(aa, bb); a = aa / ma; b = bb / ma; r *= r; for (int i = 1; i <= n; i++) { double x, y; cin >> x >> y; v.push_back({x, y}); prz.push_back({0, 0}); double pocz = -1000000000, kon = 1000000000, sr; while (kon - pocz > eps) { sr = (pocz + kon) / 2; if (dist(a * sr, b * sr, x, y) < dist(a * (sr + eps), b * (sr + eps), x, y)) { kon = sr; } else { pocz = sr; } } double srodek = pocz; pocz = -1000000000, kon = srodek; while (kon - pocz > eps) { sr = (pocz + kon) / 2; if (dist(x * sr, y * sr, x, y) > r) { pocz = sr; } else { kon = sr; } } prz.back().first = pocz; pocz = srodek, kon = 1000000000; while (kon - pocz > eps) { sr = (pocz + kon) / 2; if (dist(x * sr, y * sr, x, y) > r) { kon = sr; } else { pocz = sr; } } prz.back().second = pocz; tab.push_back({prz.back().first, 1}); tab.push_back({prz.back().second, -1}); } sort(tab.begin(), tab.end()); int res = 0; int suma = 0; for (moj &i : tab) { if (i.kiedy > -eps && i.kiedy * a < eps + aa) { res = max(res, suma); } suma += i.ile; if (i.kiedy > -eps && i.kiedy * a < eps + aa) { res = max(res, suma); } } cout << res; return 0; }