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

namespace _2.zad_plazma
{
    class Program
    {
        struct kupovina
        {
            public long dan;
            public long brp;
        }
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long n = int.Parse(s[0]);
            long q = int.Parse(s[1]);
            kupovina[] a = new kupovina[n];
            long[] b = new long[q];
            for (int i = 0; i < n; i++)
            {
                s = Console.ReadLine().Split();
                a[i].dan=long.Parse(s[0]);
                a[i].brp=long.Parse(s[1]);
            }
            for (int i = 0; i < q; i++)
            {
                b[i] = long.Parse(Console.ReadLine());
            }
            int j = 0;
            for (int i = 0; i < q; i++)
			{
                j=0;
                long maks;
                if (b[i] > a[0].dan)
                {
                    maks = b[i] - a[0].dan + 1;
                }
                else
                {
                    maks = 0;
                }
                long brp = 0;
                long minus = 0;
			    while(j<n&&b[i]>a[j].dan)
                {
                    brp += a[j].brp;
                    if (j + 1 < n && a[j + 1].dan < b[i])
                    {
                        if (brp < a[j + 1].dan - a[j].dan+1)
                        {
                            minus = a[j + 1].dan - a[j].dan  - brp;
                            brp =-1;
                        }
                        else
                        {
                            brp -= a[j + 1].dan - a[j].dan+1 ;
                        }
                    }
                    else if (j + 1 == n)
                    {
                        if (brp < b[i] - a[j].dan+1)
                        {
                            minus = b[i] - a[j].dan - brp;
                            brp = -1;
                        }
                        else
                        {
                            brp -= b[i] - a[j].dan + 1;
                        }
                    }
                    else
                    {
                        if (b[i] == a[j+1].dan)
                        {
                            brp++;
                        }
                        if (brp < b[i] - a[j].dan + 1)
                        {
                            minus = b[i] - a[j].dan  - brp;
                            brp = 0;
                        }
                        else
                        {
                            brp -= b[i] - a[j].dan +1;
                        }
                    }
                    j++;
                }
                Console.WriteLine(maks - minus);
			}
        }
    }
}