#include <iostream>
#include<vector>
using namespace std;

int main()
{
    int n,q,j=-1,p;
    cin>>n>>q;
    unsigned long long k;
    vector<unsigned long long>ost(n);
    vector<unsigned long long>r(n);
    vector<unsigned long long>d(n);
    vector<unsigned long long>res(q);
    r[0]=0;
     cin>>d[0]>>p;
     ost[0]=p;
    for(int i=1;i<n;i++) {
        cin>>d[i]>>p;
            if(d[i]-d[i-1]>ost[i-1])
            {ost[i]=p;
            r[i]=ost[i-1]+r[i-1];}
            else
                {ost[i]=ost[i-1]-d[i]+d[i-1]+p;
            r[i]=d[i]-d[i-1]+r[i-1];}

    }
     for(int i=0;i<q;i++){
     cin>>k;

       while(j<n-1&&k>=d[j+1]) j++;

     if(j>=0) {
     if(k-d[j]>ost[j])res[i]=r[j]+ost[j];
     else res[i]=r[j]+k-d[j]+1;}
     else res[i]=0;
     }
     for(int i=0;i<q;i++)
      cout<<res[i]<<endl;
    return 0;
}