#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef pair<int,int> PII;
const int N = 300010;
int n,m,k;
int a[N];
int main()
{
cin>>n>>m>>k;
for(int i = 1; i<=n; i++)
{
int x,y;
cin>>x>>y;//[x-y+1,x]之间核酸有效
a[max(x-y+1,1)]++,a[x+1]--;
}
for(int i = 1; i<=N; i++) a[i]+=a[i-1];//对差分数组求前缀和得到原数组
while(m--)
{
int t;
cin>>t;
cout<<a[t+k]<<endl;
}
return 0;
}