#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int main() {
vector<pii> p;
int n, m, a, b;
cin >> n >> m >> a >> b;
while (a--) {
int x, y;
cin >> x >> y;
p.push_back({ x, y });
}
while (b--) {
int x, y;
cin >> x >> y;
int ans = INT_MAX;
for (int i = 0; i < p.size(); i++) {
auto t = p[i];
ans = min(ans, abs(x - t.first) + abs(y - t.second));
}
cout << ans << endl;
}
return 0;
}
不懂评论喵,关注永雏塔菲谢谢喵