#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int n, q, x, z;
    cin>>n>>q;
    vector<int> d(n), k(n);
    vector<pair<int,int>> p;
    
    for(int i=0; i<n; i++){
        cin>>d[i]>>k[i];
        p.push_back({d[i], d[i]+k[i]});
    }
    for(int i = 0; i<q; i++){
        z = 0;
        cin>>x;
        for(auto& par:p){
            if(x<par.first)break;
            else if(x<par.second){
                z+= x-par.first+1;
            }
            else{
                z+= par.second-par.first;
            }
        }
        cout<<z<<endl;
        
    }
    return 0;
    
}