import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        int[][] matrix = new int[n][2];
        long[] questions = new long[q];
        long[] res = new long[q];
        for (int i = 0; i < n; i++) {
            matrix[i][0] = sc.nextInt();
            matrix[i][1] = sc.nextInt();
        }
        for (int i = 0; i < q; i++) {
            questions[i] = sc.nextLong();
        }
        for (int i = 0; i < q; i++) {
            for (int j = 0; j < n; j++) {
                if (questions[i] >= matrix[j][0]) {
                    if (questions[i] < matrix[j][1]) {
                        res[i] += matrix[j][1] - questions[i];
                    } else if (j < n - 1 && questions[i] > matrix[j][1] && questions[i] < matrix[j + 1][0] - matrix[j][0]) {
                        res[i] += questions[i] - matrix[j][0] + 1;
                    } else {
                        res[i] += matrix[j][1];
                    }
                }
            }
        }
        for (long el : res) {
            System.out.println(el);
        }
    }
}