#include <bits/stdc++.h>
using namespace std;
const int MaxK = 1e5 + 3;
int X, K, Q;
int r[MaxK];
pair<int, int> q[MaxK];
int L[MaxK], R[MaxK], SL[MaxK], SR[MaxK], sum[MaxK];
int main() {
  scanf("%d%d", &X, &K);
  for (int i = 1; i <= K; ++i) scanf("%d", r + i);
  L[0] = 0, R[0] = X, SL[0] = 0, SR[0] = X, sum[0] = 0;
  for (int i = 1; i <= K; ++i) {
    if (i % 2)
      sum[i] = sum[i - 1] - (r[i] - r[i - 1]),
      SL[i] = max(0, SL[i - 1] - (r[i] - r[i - 1])),
      SR[i] = max(0, SR[i - 1] - (r[i] - r[i - 1]));
    else
      sum[i] = sum[i - 1] + (r[i] - r[i - 1]),
      SL[i] = min(X, SL[i - 1] + (r[i] - r[i - 1])),
      SR[i] = min(X, SR[i - 1] + (r[i] - r[i - 1]));
    L[i] = max(L[i - 1], -sum[i]);
    R[i] = min(R[i - 1], sum[i]);
  }
  scanf("%d", &Q);
  for (int i = 1; i <= Q; ++i) {
    int t, a, s;
    scanf("%d%d", &t, &a);
    int p = lower_bound(r, r + K + 1, t + 1) - 1 - r;
    if (a < L[p])
      s = SL[p];
    else if (a > R[p])
      s = SR[p];
    else
      s = a + sum[p];
    if (p % 2)
      s = min(X, s + t - r[p]);
    else
      s = max(0, s - (t - r[p]));
    printf("%d\n", s);
  }
  return 0;
}
