using System;
using System.Collections.Concurrent;

namespace Mamuransam
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int N = int.Parse(s[0]);
            int Q = int.Parse(s[1]);
            long[,] pakovanja = new long[N, 2];
            long[] pitanja = new long[Q];
            for (int i = 0; i < N; i++)
            {
                s = Console.ReadLine().Split();
                pakovanja[i, 0] = long.Parse(s[0]);
                pakovanja[i, 1] = long.Parse(s[1]);
            }
            for (int i = 0; i < Q; i++)
            {
                pitanja[i] = long.Parse(Console.ReadLine());
            }
            long[] jelo = new long[pitanja[Q - 1]];
            for (long i = pakovanja[0, 0] - 1; i < pakovanja[0, 0] - 1 + pakovanja[0, 1]; i++)
            {
                jelo[i] = 1;
            }
            for (int i = 1; i < N; i++)
            {
                for (long j = Math.Max(pakovanja[i, 0] - 1, pakovanja[i - 1, 0] - 1 + pakovanja[i - 1, 1]); j < Math.Min(Math.Max(pakovanja[i, 0] - 1, pakovanja[i - 1, 0] - 1 + pakovanja[i - 1, 1]) - 1 + pakovanja[i, 1], pitanja[Q - 1]); j++)
                {
                    jelo[j] = 1;
                }
            }
            long[] resenja = new long[Q];
            for (int i = 0; i < Q; i++)
            {
                resenja[i] = 0;
                for (long j = 0; j < pitanja[i]; j++)
                    if (jelo[j] != 0)
                        resenja[i]++;
            }
            for (int i = 0; i < Q; i++)
                Console.WriteLine(resenja[i]);
        }
    }
}