using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading.Tasks;

namespace bau
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int q = int.Parse(s[1]);
            Dictionary<int, int> dict = new Dictionary<int, int>();
            for (int i = 0; i < n; i++)
            {
                s = Console.ReadLine().Split();
                int d = int.Parse(s[0]);
                int p = int.Parse(s[1]);
                for (int j = d; j <= d + p; j++)
                    dict[j] = 1;
            }
            for (int i = 0; i < q; i++)
            {
                int br = 0;
                int k = int.Parse(Console.ReadLine());
                for (int j = 0; j < k; j++)
                    if (dict.TryGetValue(j, out int b))
                        br += b;
                Console.WriteLine(br);
            }
        }
    }
}