#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int n, q;
cin >> n >> q;
// int t[1005];
// t[0] = n;
map<pair<int, int>, int> arr;
queue<pair<int, int>> que;
for(int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
que.push({x, y});
}
set<pair<int, int>> s;
vector<int> times;
for(int i = 0; i < q; i++) {
int t;
cin >> t;
times.push_back(t);
}
int time = 0;
int pos = 0;
while(true) {
while(time == times[pos]) {
cout<<que.size()<<'\n';
pos++;
}
time++;
if(pos == q) {
break;
}
vector<pair<int, int>> nodes;
while(!que.empty()) {
nodes.push_back(que.front());
s.insert(que.front());
que.pop();
}
set<pair<int, int>> setpush;
for(pair<int, int> i : nodes) {
if(!s.contains({i.first, i.second+1})) setpush.insert({i.first, i.second+1});
if(!s.contains({i.first, i.second-1})) setpush.insert({i.first, i.second-1});
if(!s.contains({i.first+1,i.second})) setpush.insert({i.first + 1, i.second});
if(!s.contains({i.first-1, i.second})) setpush.insert({i.first - 1, i.second});
}
for(pair<int, int> i : setpush) {
que.push(i);
}
}
}