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

namespace Plazma
{
    internal class Program
    {
        static ulong Pojedena(ulong[,]a, ulong upit, ulong n)
        {
            ulong i = 0;
            ulong s = 0;
            while(i<n && a[i, 0] < upit)
            {
                if (s + a[0,0]+ a[i, 1] > upit)
                {
                    return s + upit - a[i, 0] + 1;
                }
                s += a[i, 1];
                i++;
            }
            return s;
        }
        static void Main(string[] args)
        {
            string []unos1 = Console.ReadLine().Split();
            ulong n= ulong.Parse(unos1[0]),q = ulong.Parse(unos1[1]);
            ulong[,] a = new ulong[n, 2];
            ulong[] izlaz = new ulong[q];
            for(ulong i=0;i<n;i++)
            {
                unos1 = Console.ReadLine().Split();
                a[i, 0] = ulong.Parse(unos1[0]);
                a[i, 1] = ulong.Parse(unos1[1]);
            }
            for(ulong i =0;i<q;i++)
            {
                Console.WriteLine(Pojedena(a, ulong.Parse(Console.ReadLine()), n));             
            }
            Console.ReadLine();
        }
    }
}