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

namespace _2.Plazma
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int n = int.Parse(input[0]);
            int p = int.Parse(input[1]);
            long[,] matrica = new long[n, 2];
            long[] pitanja = new long[p];
            long[] resenja = new long[p];
            for (int i = 0; i < n; i++)
            {
                string[] matricaUnos = Console.ReadLine().Split();
                matrica[i, 0] = int.Parse(matricaUnos[0]);
                matrica[i, 1] = int.Parse(matricaUnos[1]);
            }
            for (int i = 0; i < p; i++)
            {
                pitanja[i] = long.Parse(Console.ReadLine());
            }
            for (int i = 0; i < pitanja.Length; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    for (long k = matrica[j, 0] - 1; k < matrica[j, 0] + matrica[j, 1] - 1; k++)
                    {
                        if (k == pitanja[i])
                            break;
                        resenja[i] += 1;
                    }
                }
            }
            for (int i = 0; i < resenja.Length; i++)
            {
                Console.WriteLine(resenja[i]);
            }
            Console.ReadKey();
        }
    }
}