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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            long n = long.Parse(s[0]);
            long q = long.Parse(s[1]);
            long[] adn = new long[n];
            long[] apn = new long[n];
            for(long i = 0; i < n; i++)
            {
                string[] s1 = Console.ReadLine().Split(' ');
                adn[i] = long.Parse(s1[0]);
                apn[i] = long.Parse(s1[1]);
            }
            long[] aq = new long[q];
            for (long i = 0; i < q; i++)
                aq[i] = long.Parse(Console.ReadLine());
            for(long i = 0; i < q; i++)
            {
                long br = 0;
                for(long j = 0; j < n && adn[j] < aq[i]; j++)
                {
                    if (aq[i] - adn[j] + 1 <= apn[j])
                        br += aq[i] - adn[j] + 1;
                    else
                        br += apn[j];
                }
                Console.WriteLine(br);
            }
        }
    }
}