#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
    vector<long long> dani(300025);
    vector<long long> plazme(300025);
    vector<long long> zbir(300025);
    int n,q;
    long long suma=0,upit,nula=0;
    cin >> n >> q;
    cin >> dani[0] >> plazme[0];
    suma=plazme[0];
    zbir[0]=0;
    for(int i=1;i<n;i++){
        cin >> dani[i] >> plazme[i];
        zbir[i]=zbir[i-1]+min(suma,dani[i]-dani[i-1]);
        suma=max(suma-dani[i]+dani[i-1],nula);
        plazme[i]+=suma;
        suma=plazme[i];
    }
    for(int i=0;i<q;i++){
        cin >> upit;
        if(upit<=dani[0]){
            if(upit==dani[0])
                cout << 1;
            else
                cout << 0;
        }
        else if(upit>=dani[n-1]){
            cout << zbir[n-1]+min(plazme[n-1],upit-dani[n-1]+1);
        }
        else{
            int l=0,r=n-1;
            while(l-r>1){
                if(dani[(r-l)/2]>upit){
                    r=(r+l)/2;
                }
                else
                    l=(r+l)/2;
            }
            cout << zbir[l]+min(plazme[l],upit-dani[l]+1);
        }
        cout << endl;
    }
    return 0;
}