#include <bits/stdc++.h>
using namespace std;
long long N,Q,K,X,Y,D,L;
struct slog{
long long D,L;
}A;
vector<slog> V;
long long NIZ2[300005];
long long RES,BROJPLAZMI,DAN;
long long funkcija(long long DAN){
    long long RES=0;
    for(int i=0;i<V.size();i++){

        if(V[i].D<=DAN){
             RES+=V[i].D-V[i].L + 1;//printf("RES= %lld \n",RES);
        }
        else if(V[i].D>DAN and V[i].L<=DAN){
                       RES+=DAN-V[i].L+1;//printf("RES= %lld \n",RES);
            break;
        }
    }
    return RES;
}
int main(){
    scanf("%lld %lld",&N,&Q);
    scanf("%lld %lld",&X,&Y);
    L=X;
    D=X+Y-1;
    for(int i=2;i<=N;i++){
            scanf("%lld %lld",&X,&Y);
            if(X>D+1){
                A.L=L;A.D=D;V.push_back(A);

                L=X;
                D=X+Y-1;
            }
            else{
                D+=Y;
            }
    }
    A.L=L;
    A.D=D;
    V.push_back(A);
/*
    for(int i=0;i<V.size();i++){
        printf("%lld %lld\n",V[i].L,V[i].D);
    }
    printf("\n");
*/
    for(int i=1;i<=Q;i++){
        scanf("%lld",&X);
        printf("%lld\n",funkcija(X));
    }

    return 0;
}