#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
double far(int x1,int y1,int x2,int y2){
return sqrt(pow(x1 - x2, 2) - pow(y1 - y2, 2));
}
int n, m, k, t;
long long maxn = -1;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
cin >> n >> m >> k >> t;
while (k--) {
int x, y;
cin >> x >> y;
long long cnt = 0;
for (int i = max(x - t, 1); i <= min(x + t, n); i++) {
for (int j = max(y - t, 1); j <= min(y + t, m); j++) {
if (far(x, y, i, j) <= t) {
cnt++;
}
}
}
maxn = max(maxn, cnt);
}
cout << maxn;
return 0;
}
本地都过了啊……