#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,q;
    cin>>n>>q;
    vector<pair<unsigned long long,unsigned long long>> v(n);
    unsigned long long resenje[n];
    cin>>v[0].first>>v[0].second;
    resenje[0]=0;
    for(int i=1;i<n;i++)
    {
        cin>>v[i].first>>v[i].second;
        if(v[i].first-v[i-1].first<v[i-1].second)
        {
            v[i].second+=(v[i-1].second-(v[i].first-v[i-1].first));
            v[i-1].second=v[i].first-v[i-1].first;
        }
        resenje[i]=resenje[i-1]+v[i-1].second;
    }
    for(int i=0;i<q;i++)
    {
        unsigned long long k,ans=-1;
        cin>>k;
        int l=0,d=n-1,mesto;
        while(l<=d)
        {
            int mid=l+(d-l)/2;

            if(v[mid].first<=k)
            {
                ans=v[mid].first;
                l=mid+1;
                mesto=mid;
            }
            else d=mid-1;
        }
        if(ans==-1) cout<<0<<"\n";
        else if(ans==k) cout<<resenje[mesto]+1<<"\n";
        else cout<<resenje[mesto]+min(k-ans+1,v[mesto].second)<<"\n";
    }
    return 0;
}