#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int tot, n, q;
int r[100005];
int sum[100005], mx[17][100005], mn[17][100005];
int lg[100005];
int nx[100005], nnx[17][100005];

void stInit() {
    int cur = 0;
    forn(i, 100005) {
        if ((2 << cur) < i) {
            ++cur;
        }
        lg[i] = cur;
    }
    forn(i, 100005) mx[0][i] = mn[0][i] = sum[i];
    forn(i, 16) forn(j, 100005 - (2 << i) + 1) {
        mx[i + 1][j] = max(mx[i][j], mx[i][j + (1 << i)]);
        mn[i + 1][j] = min(mn[i][j], mn[i][j + (1 << i)]);
    }
}

int stMax(int from, int to) {
    int lev = lg[to - from + 1];
    return max(mx[lev][from], mx[lev][to - (1 << lev) + 1]);
}

int stMin(int from, int to) {
    int lev = lg[to - from + 1];
    return min(mn[lev][from], mn[lev][to - (1 << lev) + 1]);
}

int main() {
    scanf("%d%d", &tot, &n);
    forn(i, n) scanf("%d", r + i + 1);
    r[++n] = int(2e9) + 123;
    for (int i = 1; i <= n; ++i) {
        if (i & 1) {
            sum[i] = sum[i - 1] - (r[i] - r[i - 1]);
        } else {
            sum[i] = sum[i - 1] + (r[i] - r[i - 1]);
        }
    }
    stInit();
    for (int i = 1; i <= n; ++i) {
        int lo = i + 1, hi = n + 1, mid;
        int cur = tot;
        if (i & 1) {
            cur = 0;
        }
        while (lo < hi) {
            mid = (lo + hi) >> 1;
            if (stMax(i + 1, mid) - sum[i] + cur >= tot) {
                hi = mid;
            } else if (stMin(i + 1, mid) - sum[i] + cur <= 0) {
                hi = mid;
            } else {
                lo = mid + 1;
            }
        }
        nx[i] = lo;
    }
    nx[n + 1] = n + 1;
    forn(i, n + 2) nnx[0][i] = nx[i];
    forn(i, 16) forn(j, n + 2) {
        nnx[i + 1][j] = nnx[i][nnx[i][j]];
    }
    scanf("%d", &q);
    int ind = 0;
    forn(_, q) {
        int t, a;
        scanf("%d%d", &t, &a);
        int lo = 1, hi = n + 1, mid;
        while (lo < hi) {
            mid = (lo + hi) >> 1;
            if (stMax(1, mid) + a >= tot) {
                hi = mid;
            } else if (stMin(1, mid) + a <= 0) {
                hi = mid;
            } else {
                lo = mid + 1;
            }
        }
        assert(lo != n + 1);
        while (r[ind + 1] <= t) {
            ++ind;
        }
        if (r[lo] > t) {
            int cur = a + sum[ind];
            if (ind & 1) {
                cur += t - r[ind];
            } else {
                cur -= t - r[ind];
            }
            cur = max(0, cur);
            cur = min(tot, cur);
//            cerr << "!";
            printf("%d\n", cur);
            continue;
        }
        for (int i = 16; i >= 0; --i) {
            if (nnx[i][lo] != n + 1 && r[nnx[i][lo]] <= t) {
                lo = nnx[i][lo];
            }
        }
        int cur = (lo & 1) ? 0 : tot;
        cur += sum[ind] - sum[lo];
        if (ind & 1) {
            cur += t - r[ind];
        } else {
            cur -= t - r[ind];
        }
        cur = max(0, cur);
        cur = min(tot, cur);
        printf("%d\n", cur);
    }
    return 0;
}


Measured memory_bytes: 22400