using System;

class Program
{
    static void Main()
    {
        string[] s = Console.ReadLine().Split();
        int N = int.Parse(s[0]);
        int Q = int.Parse(s[1]);

        bool[] dani = new bool[100];
        int d = 0, p = 0, Pd = 0;
        for(int i = 0; i < N; i++)
        {
            string[] s1 = Console.ReadLine().Split();
            d = int.Parse(s[0]);
            p = int.Parse(s[1]);
            while(Pd < d)
            {
                dani[Pd] = false;
                Pd++;
            }
            while(p != 0)
            {
                dani[d] = true;
                d++;
                p--;
            }
            Pd = d + 1;
        }
        for(int i = 0;i < Q;i++)
        {
            int  pitanja = int.Parse(Console.ReadLine());
            int br = 0;
            for(int j = 0;j <= pitanja;j++)
            {
                if (dani[j] == true) br++;
            }
            Console.WriteLine(br);
        }
    }
}