using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {
        static long func(long[] a,long[]b, long trazeni_dan)
        {
            long kolko_je_pojela = 0;
            long dan = 0;
            for(int i=0; i<a.Length; i++)
            {
                if(dan>trazeni_dan)
                {
                    kolko_je_pojela = kolko_je_pojela - (dan - trazeni_dan);
                    break;
                }
                if (a[i] > trazeni_dan)
                {
                    break;
                }
                if (a[i]<dan)
                {
                    kolko_je_pojela += b[i] - (dan - a[i]);
                }
                else
                {
                    kolko_je_pojela += b[i];
                }
                dan = a[i] + b[i];
            }
            return kolko_je_pojela;
        }
        static void Main()
        {
            string[] s1 = Console.ReadLine().Split(' ');
            int n = int.Parse(s1[0]);
            int q = int.Parse(s1[1]);
            long[] a = new long[n];
            long[] b = new long[n];
            for (int i = 0; i < n; i++)
            {
                string[] s = Console.ReadLine().Split(' ');
                a[i]= long.Parse(s[0]);
                b[i]= long.Parse(s[1]);
            }
            int br = 0;
            for (int i = 0; i < q; i++)
            {
                long p = long.Parse(Console.ReadLine());
                long rez = func(a, b, p);
                if (rez!=0)
                {
                    Console.WriteLine(rez+1);
                }
                else
                {
                    Console.WriteLine(rez);
                }
            }
            Console.ReadLine();
        }
    }
}