#include <bits/stdc++.h>
#define maxn 1000050
#define maxq 1000050
int n,q;
long long p[maxn], d[maxn], k[maxq];
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin >>n>>q;
    for (int i =1;i<=n;i++){
        cin >>d[i]>>p[i];
    }
    for (int j =1; j <=q; j ++){
        cin >>k[j];
    }
    while (q--){
        int br =0;
        for (int i =1; i<n; i++){
        if (i!=n){
            if (d[i]<k[q]){
                if (p[i]>d[i+1]- d[i]) br += d[i+1]-d[i]+1;
                else br+=p[i];
            }
        }
        else br += k[q]- d[i];
        cout<<br<<endl;
        }
    }
    
}