#include <bits/stdc++.h>
using namespace std;

const int N = (int)1e5;

int dat[N+5];
pair<int,int> bats[N+5];
pair<int,int> vols[N+5];

int main() {
    int x; scanf("%d", &x);
    int k; scanf("%d", &k);

    dat[0] = 0;
    bats[0] = vols[0] = make_pair(0,x);
    for (int i=1; i<=k; i++) {
        scanf("%d", dat+i);
        int diff = dat[i] - dat[i-1];

        bats[i] = bats[i-1];
        vols[i] = vols[i-1];
        if (i % 2 == 1) {
            int delta = vols[i].first - 0;
            bats[i].first += max(0, diff - delta);
            vols[i].first = max(0, vols[i].first - diff);
            vols[i].second = max(0, vols[i].second - diff);
        } else {
            int delta = x - vols[i].second;
            bats[i].second -= max(0, diff - delta);
            vols[i].first = min(x, vols[i].first + diff);
            vols[i].second = min(x, vols[i].second + diff);
        }
    }
    dat[k+1] = dat[k] + 1;

    int q; scanf("%d", &q);

    int idx = 1;
    for (int i=1; i<=q; i++) {
        int t,a; scanf("%d %d", &t, &a);
        while (dat[idx] <= t) idx++;

        int diff = t - dat[idx-1];
        int curr = vols[idx-1].first + (a - bats[idx-1].first);
        if (a <= bats[idx-1].first) {
            curr = vols[idx-1].first;
        } else if (a >= bats[idx-1].second) {
            curr = vols[idx-1].second;
        }

        if (idx % 2 == 1) {
            curr = max(0, curr - diff);
        } else {
            curr = min(x, curr + diff);
        }
        printf("%d\n", curr);
    }
    return 0;
}
