using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProCon
{

    class Program
    {
        struct TimeValue
        {
            public TimeValue(long x, long y, long z, long a)
            {
                time = x;
                diffA = y;
                MinusMax = z;
                PlusMax = a;
            }
            public long time;
            public long diffA;
            public long MinusMax;
            public long PlusMax;
        };

        static int DivideSearch(List<TimeValue> Data, long TargetTime, int IndexBegin, int IndexEnd)
        {
            if(IndexBegin + 1 == IndexEnd)
            {
                return IndexBegin;
            }
            int Tyuukan = (IndexBegin + IndexEnd) / 2;
            if( Data[Tyuukan].time >= TargetTime)
            {
                return DivideSearch( Data,TargetTime, IndexBegin, Tyuukan );
            }
            else
            {
                return DivideSearch(Data, TargetTime, Tyuukan, IndexEnd);
            }
        }

        static void Main(string[] args)
        {
            long X = long.Parse(Console.ReadLine());
            long K = long.Parse(Console.ReadLine());
            string[] input = Console.ReadLine().Split(' ');
            List<TimeValue> Data = new List<TimeValue>();
            long AValue = 0;
            long BeforeTime = 0;
            long MinusMax = 0;
            long PlusMax = 0;
            Data.Add(new TimeValue(0, 0, 0, 0));
            for (long i = 0; i < input.Count(); ++i)
            {
                long nTime = long.Parse(input[i]);
                long nDiff = nTime - BeforeTime;
                AValue += nDiff * ((i % 2 == 0) ? -1 : 1);
                MinusMax = Math.Min( MinusMax, AValue );
                PlusMax = Math.Max(PlusMax, AValue);

                Data.Add(new TimeValue( nTime, AValue, MinusMax, PlusMax));
                BeforeTime = nTime;
            }
            long Q = long.Parse(Console.ReadLine());
            for( long i = 0; i < Q; ++i)
            {
                string[] input2 = Console.ReadLine().Split(' ');
                int T = int.Parse(input2[0]);
                long A = long.Parse(input2[1]);
                int Index = DivideSearch(Data, T, 0, Data.Count());
                long MinusPenalty = Math.Min(0, A + Data[Index].MinusMax);
                long PlusPenalty = Math.Max(0, A + Data[Index].PlusMax - X);
                long Result = A + Data[Index].diffA - MinusPenalty - PlusPenalty + (T - Data[Index].time) * ((Index % 2 == 0) ? -1 : 1);
                Result = Math.Max(0, Result);
                Result = Math.Min( X, Result );
                Console.WriteLine(Result);
            }
            
        }
    }

}