#include<iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <set>

using namespace std;

class RMQ{
    static const int INT_MAX = 2147483647;
    int MAX_N;
    int highestOneBit(int i) {
        i |= (i >>  1);
        i |= (i >>  2);
        i |= (i >>  4);
        i |= (i >>  8);
        i |= (i >> 16);
        return i - (i >> 1);
    }
    public:
        int *dat;
        int *datIndexes;

        RMQ(int size = 100000){
            int HOB = highestOneBit(size);
            if (HOB != size){
                MAX_N = HOB<<1;
            }else{
                MAX_N = HOB;
            }
            dat = new int[MAX_N*2];
            datIndexes = new int[MAX_N*2];
            for (int i =1;i< MAX_N*2;i++){
                dat[i] = INT_MAX;
                datIndexes[i] = -1;
            }
        }

        void update(int index,int x){
            for (int i= index+MAX_N; i>0; i>>=1) {
            //iが対応するインデックス
                if (i >= MAX_N){
                    dat[i] = x;
                    datIndexes[i] = i-MAX_N;
                }else{
                    if (dat[i*2] <= dat[i*2+1]){
                        dat[i] = dat[i*2];
                        datIndexes[i] = datIndexes[i*2];
                    }else{
                        dat[i] = dat[i*2+1];
                        datIndexes[i] = datIndexes[i*2+1];
                    }
                }
            }
        }

        int query(int L,int R){
            L += MAX_N;
            R += MAX_N;
            int minValue = INT_MAX;
            for (;L<R; L>>=1, R>>=1) {
                if(R&1) {
                    --R;
                    if (dat[R] < minValue){
                        minValue = dat[R];
                    }
                } //--Rが対応するインデックス
                if(L&1){
                    if (dat[L] < minValue){
                        minValue = dat[L];
                    }
                    L++;
                }//L++が対応するインデックス
            }
            return minValue;
        }

        pair<int,int> queryWithIndex(int L,int R){
            L += MAX_N;
            R += MAX_N;
            int minValue = INT_MAX;
            int minIndex = -1;
            for (;L<R; L>>=1, R>>=1) {
                if(R&1) {
                    --R;
                    if (dat[R] < minValue){
                        minValue = dat[R];
                        minIndex = datIndexes[R];
                    }
                } //--Rが対応するインデックス
                if(L&1){
                    if (dat[L] < minValue){
                        minValue = dat[L];
                        minIndex = datIndexes[L];
                    }
                    L++;
                }//L++が対応するインデックス
            }
            return make_pair(minValue,minIndex);
        }
};

int tIndex(int t,vector<long long> RTotal){
    int upperIndex = RTotal.size();
    int lowerIndex = 0;
    while (upperIndex != lowerIndex + 1){
        if (t >= RTotal[(lowerIndex+upperIndex)/2]){
            lowerIndex = (lowerIndex+upperIndex)/2;
        }else{
            upperIndex = (lowerIndex+upperIndex)/2;
        }

    }

    return lowerIndex;
}

int main()
{
    // 整数の入力
    long long X,K,Q,N,a_i,i,t_i,r_i;
    vector<long long>RTotal;
    cin >> X >> K;

    RTotal.push_back(0);
    for (i= 0; i< K ; i++) {
        cin >> r_i;
        RTotal.push_back(r_i);
    }
    RMQ XCalcResult(K+1);
    XCalcResult.update(0,X);
    long long now = X;
    for (i= 1; i<= K ; i++) {
        if(i % 2 == 1){
            now = max(now - (RTotal[i] - RTotal[i-1]),0ll);
        }else{
            now = min(now + (RTotal[i] - RTotal[i-1]),X);
        }
        XCalcResult.update(i,now);
    }

    vector<long long> zeroCalcResult;
    now = 0;
    zeroCalcResult.push_back(now);
    for (i= 1; i<= K ; i++) {
        if(i % 2 == 1){
            now = max(now - (RTotal[i] - RTotal[i-1]),0ll);
        }else{
            now = min(now + (RTotal[i] - RTotal[i-1]),X);
        }
        zeroCalcResult.push_back(now);
    }

    cin >> Q;
    for (i= 0;i<Q;i++){
        cin >> t_i >> a_i;
        int j = tIndex(t_i,RTotal);
        int minSand = XCalcResult.query(0,j+1);
        if (minSand - (X - a_i) < 0){
            if (j%2 == 0){
                cout << max(zeroCalcResult[j] - (t_i - RTotal[j]),0ll)<< endl;
            }else{
                cout << min(zeroCalcResult[j] + (t_i - RTotal[j]),X)<< endl;
            }
        }else{
            if (j%2 == 0){
                cout << max(XCalcResult.query(j,j+1)- (X - a_i) - (t_i - RTotal[j]),0ll)<< endl;
            }else{
                cout << min(XCalcResult.query(j,j+1)- (X - a_i) + (t_i - RTotal[j]),X) << endl;
            }
        }

    }

    return 0;
}