#include<iostream>
#include<vector>
using namespace std;
typedef unsigned long long ullong;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    unsigned n,q;
    ullong xs,ys,x,y,t;
    cin>>n>>q>>xs>>ys;
    vector<ullong>d,p;
    for(unsigned i=1;i<n;++i){
        cin>>x>>y;
        if(xs+ys<x){
            d.push_back(xs);
            p.push_back(ys);
            xs=x;ys=y;
        }else ys+=y;}
    d.push_back(xs);
    p.push_back(ys);
    for(unsigned i=0,k=0,a=0,m=(unsigned)d.size();i<q;++i){
        cin>>t;
        while(k<m&&t>=d[k]+p[k])
            a+=p[k++];
        if(k==m||t<d[k])cout<<a<<'\n';
        else cout<<a+t+1ull-d[k]<<'\n';}
    return 0;}