#include <bits/stdc++.h>

#define ull unsigned long long
using interval = std::pair<ull, ull>;

ull qs[300001];
ull psum[300001];
interval is[300001];

int binarna(ull br, int hi)
{
    int lo = 0, ic = hi, ind = -1;

    while(lo <= hi)
    {
        int mid = lo + ((hi - lo) / 2);
        interval& in = is[mid];

        if(br >= in.first && br <= in.second)
            return mid;

        if(in.second < br)
        {
            ind = mid;
            lo = mid + 1;
        }
        else
            hi = mid - 1;
    }

    if(br > is[ic].second)
        ind = -2;

    return ind;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    int N, Q, ic = 0;
    std::cin >> N >> Q;
    for(int i = 0; i < N; i++)
    {
        ull dan, broj;
        std::cin >> dan >> broj;

        if(ic != 0 && is[ic - 1].second > dan)
        {
            dan = is[ic - 1].second;
            is[ic - 1].second = dan + broj;
        }
        else
        {
            is[ic].first = dan;
            is[ic].second = dan + broj;
            ic++;
        }
    }
    for(int i = 0; i < Q; i++)
    {
        std::cin >> qs[i];
    }

    psum[0] = is[0].second - is[0].first;
    for(int i = 1; i < ic; i++)
        psum[i] = psum[i - 1] + (is[i].second - is[i].first);

    for(int i = 0; i < Q; i++)
    {
        int ind = binarna(qs[i], ic - 1);
        if(ind == -1)
            std::cout << "0\n";
        else if(ind == -2)
            std::cout << psum[ic - 1] << "\n";
        else
        {
            ull ans = 0;
            if(ind > 0)
                ans += psum[ind - 1];
            
            if(is[ind].second <= qs[i])
                ans += is[ind].second - is[ind].first;
            else if(is[ind].first == qs[i])
                ans++;
            else if(is[ind].first < qs[i])
                ans += qs[i] - (is[ind].first - 1);

            std::cout << ans << "\n";
        }
    }

    return 0;
}