#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const ll N = 1005;
ll n, r, a[N][4], nxt[N][2], ans;
ll dist(ll x1, ll y1, ll x2, ll y2){
return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
int main(){
cin >> n >> r;
for (ll i = 0; i < n; i ++){
for (ll j = 0; j < 4; j ++)
cin >> a[i][j];
nxt[i][0] = a[i][2] - a[i][0];
nxt[i][1] = a[i][3] - a[i][1];
}
r *= r;
for (ll g = 0; g < 20000; g ++){
ll cnt = 0;
for (ll i = 0; i < n; i ++){
cnt += (dist(0, 0, a[i][0], a[i][1]) <= r);
a[i][0] += nxt[i][0], a[i][1] += nxt[i][1];
}
ans = max(ans, cnt);
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |