using System;
using System.Linq;
using System.IO;

public class Program    
{
    public static void Main()
    {
        string[] nq = Console.ReadLine().Split(' ');
        int n = int.Parse(nq[0]);
        int q = int.Parse(nq[1]);
        long[,] plazma = new long[n, 2];
        for (int i = 0; i < n; i++)
        {
            string[] s = Console.ReadLine().Split(' ');
            plazma[i, 0] = long.Parse(s[0]);
            plazma[i, 1] = long.Parse(s[1]);
        }
        long[] prestala = new long[q];
        for (int j = 0; j < q; j++)
            prestala[j] = long.Parse(Console.ReadLine());

        long pojedenaPlazma = 0;
        for (int k = 0; k < q; k++)
        {
            for (int j = 0; j < n; j++)
            {
                if (prestala[k] >= plazma[j, 0])
                {
                    if (prestala[k] < plazma[j, 1])
                    {
                        pojedenaPlazma += plazma[j, 1] - prestala[k];
                    }
                    else if (prestala[k] > plazma[j, 1] && j < n - 1 && prestala[k] < plazma[j + 1, 0] - plazma[j, 0])
                    {
                        pojedenaPlazma += prestala[k] - plazma[j, 0] + 1;
                    }
                    else
                    {
                        pojedenaPlazma += plazma[j, 1];
                    }
                }
            }
            Console.WriteLine(pojedenaPlazma);
            pojedenaPlazma = 0;
        }
    }
}