import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int q = in.nextInt();
        long[] d = new long[300005];
        long[] p = new long[300005];
        long[] pref = new long[300005];
        ArrayList<long[]> intervals = new ArrayList<>();
        for (int i = 0; i < n; ++i) {
            d[i] = in.nextLong();
            p[i] = in.nextLong();
        }
        long curs = d[0];
        long cure = d[0] + p[0] - 1;
        for (int i = 1; i < n; ++i) {
            if (d[i] <= cure + 1) {
                cure = d[i] + ((cure - d[i] + 1) + p[i]) - 1;
            } else {
                intervals.add(new long[]{curs, cure});
                curs = d[i];
                cure = d[i] + p[i] - 1;
            }
        }
        intervals.add(new long[]{curs, cure});
        pref[0] = intervals.get(0)[1] - intervals.get(0)[0] + 1;
        for (int i = 1; i < intervals.size(); ++i) {
            pref[i] = pref[i - 1] + (intervals.get(i)[1] - intervals.get(i)[0] + 1);
        }
        while (q-- > 0) {
            long k = in.nextLong();
            if (k < intervals.get(0)[0]) {
                System.out.println(0);
                continue;
            }
            int idx = -1;
            int l = 0, r = intervals.size() - 1;
            while (l <= r) {
                int mid = (l + r) / 2;
                if (intervals.get(mid)[0] <= k) {
                    idx = mid;
                    l = mid + 1;
                } else {
                    r = mid - 1;
                }
            }
            long ans = pref[idx] - (intervals.get(idx)[1] > k ? (intervals.get(idx)[1] - k) : 0L);
            System.out.println(ans);
        }
    }
}