You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
struct node {
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
node a[110];
|
|
|
|
int n, L;
|
|
|
|
|
|
|
|
vector<int> X, Y;
|
|
|
|
|
|
|
|
int ans;
|
|
|
|
int main() {
|
|
|
|
cin >> n >> L;
|
|
|
|
for (int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].y;
|
|
|
|
|
|
|
|
for (int i = 1; i <= n; i++) {
|
|
|
|
X.push_back(a[i].x);
|
|
|
|
X.push_back(a[i].x - L);
|
|
|
|
Y.push_back(a[i].y);
|
|
|
|
Y.push_back(a[i].y - L);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < X.size(); i++) {
|
|
|
|
for (int j = 0; j < Y.size(); j++) {
|
|
|
|
int cnt = 0;
|
|
|
|
int lx = X[i], ly = Y[j];
|
|
|
|
for (int k = 1; k <= n; k++)
|
|
|
|
if (a[k].x >= lx && a[k].x <= lx + L && a[k].y >= ly && a[k].y <= ly + L)
|
|
|
|
cnt++;
|
|
|
|
|
|
|
|
ans = max(ans, cnt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << ans << endl;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|