#include <bits/stdc++.h>
#define MAXN 600005
#define MAXQ 300005
#define MOD 998244353
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define ll long long

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update>

pll a[600010], b[300005], c[300005];

void solve() {

    int n, q;cin>>n>>q;

    for(int i = 0;i<n; i++)
    {
        ll p, d;cin>>d>>p;
        b[i]={d, d+p-1};
    }
    for(int i = 0; i<q; i++)
    {
        ll t;cin>>t;
        c[i]={t, 0};
    }

    int pa=0, pb=0, pc=0;
    while(pb<n && pc<q)
    {
        if(b[pb].first<c[pc].first)a[pa]=b[pb++];
        else if(b[pb].first==c[pc].first)
        {
            if(b[pb].second>=c[pc].second)a[pa]=b[pb++];
            else a[pa]=c[pc++];
        }else a[pa]=c[pc++];
        pa++;
    }

    while(pb<n)a[pa++]=b[pb++];
    while(pc<q)a[pa++]=c[pc++];

    ll poc=-1, kraj = -1, prev = 0, tr = -1;

    for(int i = 0; i<n+q; i++)
    {
        tr = a[i].first;

        if(tr>=kraj && poc!=-1 && kraj!=-1)
        {
            prev+=kraj-poc+1;
            poc = -1;
        }

        if(a[i].second!=0)
        {
            if(poc==-1)
            {
                poc = a[i].first;
                kraj = a[i].second;
            }else
            {
                kraj+=(a[i].second-a[i].first+1);
            }
        }else
        {
            if(poc==-1)cout<<prev<<"\n";
            else cout<<prev+(tr-poc+1)<<"\n";
        }
    }

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    //int t;cin>>t;
    int t = 1;
    while (t--) {
        solve();
    }

    return 0;
}