//#pragma warning disable

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

public class Test
{
    public static void Main()
    {
        var X = long.Parse(Console.ReadLine());
        var K = long.Parse(Console.ReadLine());
        var r = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var Q = long.Parse(Console.ReadLine());

        // キャッシュ構築、時刻が１つズレるので注意
        var aRedMax = new long[K + 1];  // 赤文字
        var aRedMin = new long[K + 1];
        var aBlueMax = new long[K + 1];  // 青文字
        var aBlueMin = new long[K + 1];

        aRedMax[0] = X;
        aRedMin[0] = 0;
        aBlueMax[0] = X;
        aBlueMin[0] = 0;

        for (int i = 0; i < K; i++)
        {
            var timeElapsed = r[i] - (i == 0 ? 0 : r[i - 1]);

            aBlueMax[i + 1] = aBlueMax[i];
            aBlueMin[i + 1] = aBlueMin[i];

            if (i % 2 == 0)
            {
                // Aに入っている砂は減る
                aRedMax[i + 1] = aRedMax[i] - timeElapsed;
                aRedMin[i + 1] = aRedMin[i] - timeElapsed;

                if (aRedMin[i + 1] < 0)
                {
                    aBlueMin[i + 1] += (-aRedMin[i + 1]);
                    aRedMin[i + 1] = 0;
                }
            }
            else
            {
                // Aに入っている砂は増える
                aRedMax[i + 1] = aRedMax[i] + timeElapsed;
                aRedMin[i + 1] = aRedMin[i] + timeElapsed;

                if (aRedMax[i + 1] > X)
                {
                    aBlueMax[i + 1] -= (aRedMax[i + 1] - X);
                    aRedMax[i + 1] = X;
                }
            }
        }

        for (int i = 0; i < K + 1; i++)
        {
            //Console.WriteLine(aRedMax[i] + "," + aRedMin[i] + "," + aBlueMax[i] + "," + aBlueMin[i]);
        }
        
        for (int i = 0; i < Q; i++)
        {
            var line2 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            var t = line2[0];
            var a = line2[1];

            var index = Array.BinarySearch<long>(r, t);

            if (index < 0) index = (~index);
            else index = index + 1;

            // aRedMax[index] をキャッシュとして用いる

            long timeElapsed = t - (index == 0 ? 0 : r[index - 1]);

            //Console.WriteLine(timeElapsed);
            //Console.WriteLine(aRedMax[index] + "," + aRedMin[index] + "," + aBlueMax[index] + "," + aBlueMin[index]);

            long result = -1;

            if (a < aBlueMin[index])
            {
                result = aRedMin[index];
            }
            else if (a > aBlueMax[index])
            {
                result = aRedMax[index];
            }
            else
            {
                result = a - aBlueMin[index] + aRedMin[index];
            }

            if (index % 2 == 0)
            {
                // Aの砂は減る
                result -= timeElapsed;
            }
            else
            {
                // Aの砂は増える
                result += timeElapsed;
            }

            if (result < 0) result = 0;
            if (result > X) result = X;

            Console.WriteLine(result);

        }




    }
}