#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <unordered_set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <vector>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ii pair<int,int>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define plii pair<ll,pair<int,int>>
#define heapmax(type) priorpy_queue<type>
#define heapmin(type) priorpy_queue<type,vector<type>,greater<type>>
#define ordered_multiset tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_starttistics_node_update>
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_starttistics_node_update>
#define FjSTIO ios::sync_with_stdio(NULL); cin.tie(NULL); cout.tie(NULL);
#define sz(x) (int)x.size()
#define all(x) (x).begin(),(x).end()
#define getbp(mask,i) ((mask >> i) & 1)
const ll mod = 1e9 + 7;
const ld PI = acos(-1);
const int N = 4e5+100;
const int N_Trie = 1e5;
const int N_ST = 2e5 + 10;
const int N_xIT = 2e5 + 10;
const int LIM = 1e7; // N_Prime
const int N_MST = 1e5; // N of Merge Sort Tree
const int N_Hash = 2e6 + 10;
// sort(all(V));
// V.res2ize(unique(all(V)) - V.begin());*/
struct Trie_Number{
struct DT{
ii c[2];
};
DT trie[32*N_Trie];
bool vve[33];
int pw[32] , am = 0;
void xuilt_PW(){
pw[0] = 1;
for (int i = 1; i < 32; i++) pw[i] = pw[i - 1] * 2;
}
void _res2et(){
memset(vve,0,sizeof(vve));
memset(trie,0,sizeof(trie));
}
void _change(int x){
int p = 0;
while (x > 0){
vve[++p] = x % 2;
x /= 2;
}
while (p < 32) vve[++p] = 0;
}
void _add(int x){
_change(x);
int node = 0;
for (int i = 32; i >= 1; i--){
int w = vve[i];
if (!trie[node].c[w].fi) trie[node].c[w].fi = ++am;
trie[node].c[w].se++;
if (i > 1) node = trie[node].c[w].fi;
}
}
void _delete(int x){
_change(x);
int node = 0;
for (int i = 32; i >= 1; i--){
int w = vve[i];
if (!trie[node].c[w].fi){
return;
}
if (trie[node].c[w].se == 0){
return;
}
if (i > 1) node = trie[node].c[w].fi;
}
node = 0;
for (int i = 32; i >= 1; i--){
int w = vve[i];
// if (trie[node].c[w].se > 0)
trie[node].c[w].se--;
if (i > 1) node = trie[node].c[w].fi;
}
}
int _get(int k){
int node = 0 , res2 = 0;
for (int i = 32; i >= 1; i--){
if (k <= trie[node].c[0].se){
if (!trie[node].c[0].se) return -1;
node = trie[node].c[0].fi;
}
else{
if (!trie[node].c[1].se) return -1;
k = k - trie[node].c[0].se;
node = trie[node].c[1].fi;
res2 = res2 + pw[i - 1];
}
}
return res2;
}
};
ll gcd(ll a, ll b) {
if (b == 0) return a;
else return gcd(b, a % b);
}
ll snt[LIM + 2];
void Sieve() {
for(ll i = 1; i <= LIM; i++) snt[i] = 0;
for(ll i = 1; i <= LIM; i++) {
for(ll j = i; j <= LIM; j += i) {
snt[j] += i;
}
}
}
bool ktsnt(ll n) {
if (n <= 1) return false;
if (n <= 3) return true;
if (n % 2 == 0 || n % 3 == 0) return false;
for (int i = 5; i * i <= n; i += 6) {
if (n % i == 0 || n % (i + 2) == 0){
return false;
}
}
return true;
}
ll mul(ll a,ll b,ll c){ // O(log(min(a,b)))
if (a < b) swap(a,b);
ll res2 = 0;
a = a % c;
for (; b > 0; b >>= 1 , a = (a + a) % c)
if (b & 1) res2 = (res2 + a) % c;
return res2;
}
ll power(ll a,ll b,ll c){ // O(log(b))
ll res2 = 1;
a = a % c;
for (; b > 0; b >>= 1 , a = a * a % c)
if (b & 1) res2 = res2 * a % c;
return res2;
}
ll power_mul(ll a,ll b,ll c){ // O(log(b)^2)
ll res2 = 1;
a = a % c;
for (; b > 0; b >>= 1 , a = mul(a,a,c))
if (b & 1) res2 = mul(res2,a,c);
return res2;
}
void file(const string FILE){
if (fopen((FILE + ".INP").c_str(),"r")){
freopen((FILE + ".INP").c_str(), "r", stdin);
freopen((FILE + ".OUT").c_str(), "w", stdout);
}
}
struct cc {
int x, y;
};
void solve(){
int n, q, l;
cin >> n >> q >> l;
vector<cc> p(n);
for (int i = 0; i < n; i++) cin >> p[i].x >> p[i].y;
vector<int> qu(q);
for (int i = 0; i < q; i++) cin >> qu[i];
sort(p.begin(), p.end(), [](const cc& a, const cc& b) {
return a.x < b.x;
});
for (int i = 0; i < q; i++) {
int z = qu[i];
int cnt = 0;
auto lower = lower_bound(p.begin(), p.end(), z - l, [](const cc& point, int v) {
return point.x < v;
});
auto upper = upper_bound(p.begin(), p.end(), z + l, [](int v, const cc& point) {
return v < point.x;
});
for (auto it = lower; it != upper; it++) {
if (abs(it->x - z) + it->y <= l) {
cnt++;
}
}
cout << cnt << "\n";
}
}
int main(){
//file("sqrt");
FjSTIO;
int t = 1;
//cin >> t;
while(t--){
solve();
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPHN0ZGlvLmg+CgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8dW5vcmRlcmVkX3NldD4KI2luY2x1ZGUgPGJpdHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHVub3JkZXJlZF9tYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPGRlcXVlPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8ZXh0L3BiX2RzL2Fzc29jX2NvbnRhaW5lci5ocHA+CiNpbmNsdWRlIDxleHQvcGJfZHMvdHJlZV9wb2xpY3kuaHBwPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdXNpbmcgbmFtZXNwYWNlIF9fZ251X3BiZHM7Cg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Fjb3MoLTEpOwpjb25zdCBpbnQgTiA9IDRlNSsxMDA7CmNvbnN0IGludCBOX1RyaWUgPSAxZTU7CmNvbnN0IGludCBOX1NUID0gMmU1ICsgMTA7CmNvbnN0IGludCBOX3hJVCA9IDJlNSArIDEwOwpjb25zdCBpbnQgTElNID0gMWU3OyAvLyBOX1ByaW1lCmNvbnN0IGludCBOX01TVCA9IDFlNTsgLy8gTiBvZiBNZXJnZSBTb3J0IFRyZWUKY29uc3QgaW50IE5fSGFzaCA9IDJlNiArIDEwOwoKLy8gc29ydChhbGwoVikpOwovLyBWLnJlczJpemUodW5pcXVlKGFsbChWKSkgLSBWLmJlZ2luKCkpOyovCgpzdHJ1Y3QgVHJpZV9OdW1iZXJ7CiAgICBzdHJ1Y3QgRFR7CiAgICAgICAgaWkgY1syXTsKICAgIH07CiAgICBEVCB0cmllWzMyKk5fVHJpZV07CiAgICBib29sIHZ2ZVszM107CiAgICBpbnQgcHdbMzJdICwgYW0gPSAwOwogICAgdm9pZCB4dWlsdF9QVygpewogICAgICAgIHB3WzBdID0gMTsKICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IDMyOyBpKyspIHB3W2ldID0gcHdbaSAtIDFdICogMjsKICAgIH0KICAgIHZvaWQgX3JlczJldCgpewogICAgICAgIG1lbXNldCh2dmUsMCxzaXplb2YodnZlKSk7CiAgICAgICAgbWVtc2V0KHRyaWUsMCxzaXplb2YodHJpZSkpOwogICAgfQogICAgdm9pZCBfY2hhbmdlKGludCB4KXsKICAgICAgICBpbnQgcCA9IDA7CiAgICAgICAgd2hpbGUgKHggPiAwKXsKICAgICAgICAgICAgdnZlWysrcF0gPSB4ICUgMjsKICAgICAgICAgICAgeCAvPSAyOwogICAgICAgIH0KICAgICAgICB3aGlsZSAocCA8IDMyKSB2dmVbKytwXSA9IDA7CiAgICB9CiAgICB2b2lkIF9hZGQoaW50IHgpewogICAgICAgIF9jaGFuZ2UoeCk7CiAgICAgICAgaW50IG5vZGUgPSAwOwogICAgICAgIGZvciAoaW50IGkgPSAzMjsgaSA+PSAxOyBpLS0pewogICAgICAgICAgICBpbnQgdyA9IHZ2ZVtpXTsKICAgICAgICAgICAgaWYgKCF0cmllW25vZGVdLmNbd10uZmkpIHRyaWVbbm9kZV0uY1t3XS5maSA9ICsrYW07CiAgICAgICAgICAgIHRyaWVbbm9kZV0uY1t3XS5zZSsrOwogICAgICAgICAgICBpZiAoaSA+IDEpIG5vZGUgPSB0cmllW25vZGVdLmNbd10uZmk7CiAgICAgICAgfQogICAgfQogICAgdm9pZCBfZGVsZXRlKGludCB4KXsKICAgICAgICBfY2hhbmdlKHgpOwogICAgICAgIGludCBub2RlID0gMDsKICAgICAgICBmb3IgKGludCBpID0gMzI7IGkgPj0gMTsgaS0tKXsKICAgICAgICAgICAgaW50IHcgPSB2dmVbaV07CiAgICAgICAgICAgIGlmICghdHJpZVtub2RlXS5jW3ddLmZpKXsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAodHJpZVtub2RlXS5jW3ddLnNlID09IDApewogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChpID4gMSkgbm9kZSA9IHRyaWVbbm9kZV0uY1t3XS5maTsKICAgICAgICB9CiAgICAgICAgbm9kZSA9IDA7CiAgICAgICAgZm9yIChpbnQgaSA9IDMyOyBpID49IDE7IGktLSl7CiAgICAgICAgICAgIGludCB3ID0gdnZlW2ldOwogICAgICAgICAgICAvLyBpZiAodHJpZVtub2RlXS5jW3ddLnNlID4gMCkKICAgICAgICAgICAgICAgIHRyaWVbbm9kZV0uY1t3XS5zZS0tOwogICAgICAgICAgICBpZiAoaSA+IDEpIG5vZGUgPSB0cmllW25vZGVdLmNbd10uZmk7CiAgICAgICAgfQogICAgfQogICAgaW50IF9nZXQoaW50IGspewogICAgICAgIGludCBub2RlID0gMCAsIHJlczIgPSAwOwogICAgICAgIGZvciAoaW50IGkgPSAzMjsgaSA+PSAxOyBpLS0pewogICAgICAgICAgICBpZiAoayA8PSB0cmllW25vZGVdLmNbMF0uc2UpewogICAgICAgICAgICAgICAgaWYgKCF0cmllW25vZGVdLmNbMF0uc2UpIHJldHVybiAtMTsKICAgICAgICAgICAgICAgIG5vZGUgPSB0cmllW25vZGVdLmNbMF0uZmk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZXsKICAgICAgICAgICAgICAgIGlmICghdHJpZVtub2RlXS5jWzFdLnNlKSByZXR1cm4gLTE7CiAgICAgICAgICAgICAgICBrID0gayAtIHRyaWVbbm9kZV0uY1swXS5zZTsKICAgICAgICAgICAgICAgIG5vZGUgPSB0cmllW25vZGVdLmNbMV0uZmk7CiAgICAgICAgICAgICAgICByZXMyID0gcmVzMiArIHB3W2kgLSAxXTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzMjsKICAgIH0KfTsKbGwgZ2NkKGxsIGEsIGxsIGIpIHsKICBpZiAoYiA9PSAwKSByZXR1cm4gYTsKICBlbHNlIHJldHVybiBnY2QoYiwgYSAlIGIpOwp9CmxsIHNudFtMSU0gKyAyXTsKdm9pZCBTaWV2ZSgpIHsKICBmb3IobGwgaSA9IDE7IGkgPD0gTElNOyBpKyspIHNudFtpXSA9IDA7CiAgZm9yKGxsIGkgPSAxOyBpIDw9IExJTTsgaSsrKSB7CiAgICBmb3IobGwgaiA9IGk7IGogPD0gTElNOyBqICs9IGkpIHsKICAgICAgc250W2pdICs9IGk7CiAgICB9CiAgfQp9CmJvb2wga3RzbnQobGwgbikgewogIGlmIChuIDw9IDEpIHJldHVybiBmYWxzZTsKICBpZiAobiA8PSAzKSByZXR1cm4gdHJ1ZTsKICBpZiAobiAlIDIgPT0gMCB8fCBuICUgMyA9PSAwKSByZXR1cm4gZmFsc2U7CiAgZm9yIChpbnQgaSA9IDU7IGkgKiBpIDw9IG47IGkgKz0gNikgewogICAgaWYgKG4gJSBpID09IDAgfHwgbiAlIChpICsgMikgPT0gMCl7CiAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KICB9CiAgcmV0dXJuIHRydWU7Cn0KbGwgbXVsKGxsIGEsbGwgYixsbCBjKXsgLy8gTyhsb2cobWluKGEsYikpKQogICAgaWYgKGEgPCBiKSBzd2FwKGEsYik7CiAgICBsbCByZXMyID0gMDsKICAgIGEgPSBhICUgYzsKICAgIGZvciAoOyBiID4gMDsgYiA+Pj0gMSAsIGEgPSAoYSArIGEpICUgYykKICAgICAgICBpZiAoYiAmIDEpIHJlczIgPSAocmVzMiArIGEpICUgYzsKICAgIHJldHVybiByZXMyOwp9CmxsIHBvd2VyKGxsIGEsbGwgYixsbCBjKXsgLy8gTyhsb2coYikpCiAgICBsbCByZXMyID0gMTsKICAgIGEgPSBhICUgYzsKICAgIGZvciAoOyBiID4gMDsgYiA+Pj0gMSAsIGEgPSBhICogYSAlIGMpCiAgICAgICAgaWYgKGIgJiAxKSByZXMyID0gcmVzMiAqIGEgJSBjOwogICAgcmV0dXJuIHJlczI7Cn0KbGwgcG93ZXJfbXVsKGxsIGEsbGwgYixsbCBjKXsgLy8gTyhsb2coYileMikKICAgIGxsIHJlczIgPSAxOwogICAgYSA9IGEgJSBjOwogICAgZm9yICg7IGIgPiAwOyBiID4+PSAxICwgYSA9IG11bChhLGEsYykpCiAgICAgICAgaWYgKGIgJiAxKSByZXMyID0gbXVsKHJlczIsYSxjKTsKICAgIHJldHVybiByZXMyOwp9CnZvaWQgZmlsZShjb25zdCBzdHJpbmcgRklMRSl7CiAgICBpZiAoZm9wZW4oKEZJTEUgKyAiLklOUCIpLmNfc3RyKCksInIiKSl7CiAgICAgICAgZnJlb3BlbigoRklMRSArICIuSU5QIikuY19zdHIoKSwgInIiLCBzdGRpbik7CiAgICAgICAgZnJlb3BlbigoRklMRSArICIuT1VUIikuY19zdHIoKSwgInciLCBzdGRvdXQpOwogICAgfQp9CnN0cnVjdCBjYyB7CiAgICBpbnQgeCwgeTsKfTsKdm9pZCBzb2x2ZSgpewogICAgaW50IG4sIHEsIGw7CiAgICBjaW4gPj4gbiA+PiBxID4+IGw7CgogICAgdmVjdG9yPGNjPiBwKG4pOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIGNpbiA+PiBwW2ldLnggPj4gcFtpXS55OwogICAgdmVjdG9yPGludD4gcXUocSk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IHE7IGkrKykgY2luID4+IHF1W2ldOwogICAgc29ydChwLmJlZ2luKCksIHAuZW5kKCksIFtdKGNvbnN0IGNjJiBhLCBjb25zdCBjYyYgYikgewogICAgICAgIHJldHVybiBhLnggPCBiLng7CiAgICB9KTsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IHE7IGkrKykgewogICAgICAgIGludCB6ID0gcXVbaV07CiAgICAgICAgaW50IGNudCA9IDA7CiAgICAgICAgYXV0byBsb3dlciA9IGxvd2VyX2JvdW5kKHAuYmVnaW4oKSwgcC5lbmQoKSwgeiAtIGwsIFtdKGNvbnN0IGNjJiBwb2ludCwgaW50IHYpIHsKICAgICAgICAgICAgcmV0dXJuIHBvaW50LnggPCB2OwogICAgICAgIH0pOwoKICAgICAgICBhdXRvIHVwcGVyID0gdXBwZXJfYm91bmQocC5iZWdpbigpLCBwLmVuZCgpLCB6ICsgbCwgW10oaW50IHYsIGNvbnN0IGNjJiBwb2ludCkgewogICAgICAgICAgICByZXR1cm4gdiA8IHBvaW50Lng7CiAgICAgICAgfSk7CiAgICAgICAgZm9yIChhdXRvIGl0ID0gbG93ZXI7IGl0ICE9IHVwcGVyOyBpdCsrKSB7CiAgICAgICAgICAgIGlmIChhYnMoaXQtPnggLSB6KSArIGl0LT55IDw9IGwpIHsKICAgICAgICAgICAgICAgIGNudCsrOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBjb3V0IDw8IGNudCA8PCAiXG4iOwogICAgfQp9CmludCBtYWluKCl7CiAgLy9maWxlKCJzcXJ0Iik7CiAgRmpTVElPOwogIGludCB0ID0gMTsKICAvL2NpbiA+PiB0OwogIHdoaWxlKHQtLSl7CiAgICBzb2x2ZSgpOwogIH0KICByZXR1cm4gMDsKfQ==