using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		long x = long.Parse(Console.ReadLine());
		int k = int.Parse(Console.ReadLine());
    long[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);
    long[] times = new long[k+1];
    for(int i = 0; i < k; i++) times[i+1] = nums[i];
    int reverseCount = 0;
    int q = int.Parse(Console.ReadLine());
    long sum = 0;//初期からのAの増減
    long Azero = 0;//初期0の時のAの変動
    long Bzero = x;//初期xの時
    long AzeroMax = 0;//Aが0になるAの最大値
    long BzeroMin = x;//AがxになるBの最小値

    for(int i = 0; i < q; i++)
    {
      string[] input = Console.ReadLine().Split(' ');
      long t = long.Parse(input[0]);
      long a = long.Parse(input[1]);

      if(reverseCount < k)
      {
        while(times[reverseCount+1] < t)
        {
          long tt = times[reverseCount+1];
          reverseCount++;
          if(reverseCount % 2 == 1)//Aが減る
          {
            sum -= tt;
            AzeroMax = Math.Max(AzeroMax, -sum);
          
            Azero -= tt;
            if(Azero < 0) Azero = 0;
            else if(Azero > x) Azero = x;
            Bzero -= tt;
            if(Bzero < 0) Bzero = 0;
            else if(Bzero > x) Bzero = x;
          }else
          {
            sum += tt;
            BzeroMin = Math.Min(BzeroMin, sum);
        
            Azero += tt;
            if(Azero < 0) Azero = 0;
            else if(Azero > x) Azero = x;
            Bzero += tt;
            if(Bzero < 0) Bzero = 0;
            else if(Bzero > x) Bzero = x;
          }
          if(reverseCount == k) break;
        }  
      }
      if(a <= AzeroMax) Console.WriteLine(Azero);
      else if(a >= BzeroMin) Console.WriteLine(Bzero);
      else
      {
        long answer = a + sum;
        if(answer < 0) answer = 0;
        else if(answer > x) answer = x;

        if(reverseCount % 2 == 1)
        {
          answer += t - times[reverseCount];
        }else
        {
          answer -= t - times[reverseCount];
        }

        if(answer < 0) answer = 0;
        else if(answer > x) answer = x;
        Console.WriteLine(answer);
      }
    }
	}
}