#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ios ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
#define pb push_back
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> os;
typedef unsigned long long ull;
typedef long long ll;
int main(){
    ios;
    int n, q;
    cin>>n>>q;
    vector<pair<ll,ll>> unos(n);
    for(int i = 0;i<n;i++){
        cin>>unos[i].first>>unos[i].second;
    }
    vector<ll> upiti(q);
    for(int i = 0;i<q;i++)cin>>upiti[i];
    ll tr = 0;
    ll nema = 0;
    ll prethodnidan = 1;
    int trdan = 0;
    int trupit = 0;
    while(trupit<q){
        while(trdan<n && unos[trdan].first < upiti[trupit]){
            nema+=max(0ll, unos[trdan].first - (prethodnidan + tr));
            if(unos[trdan].first - (prethodnidan + tr)>0)tr=0;
            else tr-=(unos[trdan].first - prethodnidan);
            prethodnidan = unos[trdan].first;
            tr+=unos[trdan].second;
            trdan++;
        }
        ll nema2 = max(0ll, upiti[trupit] - (prethodnidan + tr - 1));
        cout<<upiti[trupit] - nema - nema2<<endl;
        trupit++;
    }


}