#include using namespace std; double dist(double a, double b, double c, double d){ return (a - c)*(a - c) + (b -d)*(b - d); } int main(){ ios::sync_with_stdio (false); cin.tie(0); int n; int aa, bb,rr; double a, b, r; vector > inter; double x[n], y[n]; cin >> n >> rr >> aa >> bb; a = aa; b = bb; r = rr; r += 5 * 1e-4; for(int i = 0; i> k >> l; x[i] = k; y[i] = l; if(abs(a) < abs(b)) swap(x[i], y[i]); } if(abs(a) < abs(b)) swap(a, b); for(int i = 0; i= 1e-7){ double xx = dist(x[i], y[i], (d + 2*h)/3, (d + 2*h)*b/a/3); double yy = dist(x[i], y[i], (2*d + h)/3, (2*d + h)*b/a/3); if(xx < r*r){ gut = (2*h + d)/3; break; } if(yy < r*r){ gut = (h + 2*d)/3; break; } if(xx > yy){ h = (d + 2*h) / 3; rr = h; } else{ d = (2*d + h) / 3; l = d; } //cout << xx << " " << yy<< endl; } * */ //gut = (a*x[i] + b*y[i])/(a + b); //if(dist(gut, gut * b / a, x[i], y[i]) > r*r) continue; double k = (1 + b*b/a/a); double l = (-2*x[i]-2*y[i]*b/a); double m = x[i]*x[i] + y[i]*y[i] - r*r; if(l*l - 4*k*m < 0) continue; double x0 = (-l + sqrt(l*l - 4*k*m)) / 2 / k; double x1 = (-l - sqrt(l*l - 4*k*m)) / 2 / k; //cout << gut << endl; /*double gt = gut; while(h - gt >= 1e-4){ double xx = dist(x[i], y[i], (gt + h)/2, (gt + h)*b/a/2); if(xx > r*r) h = (h + gt) / 2; else gt = (h + gt) / 2; } */ inter.push_back({x1, 1}); inter.push_back({x0, -1}); } //cout << inter.size() << endl; sort(inter.begin(), inter.end()); int cur = 0; int ans = 0; for(auto x: inter){ //cout << x.first << " " << x.second << endl; cur += x.second; ans = max(ans, cur); } cout << ans << endl; }