#include <bits/stdc++.h>
using namespace std;
int R[100005], b[100005], i, j, k, l, s, n, m, tot, X, x, y, G[100005], Q,
    sum[100005], T[100005];
int main() {
  scanf("%d", &X);
  scanf("%d", &k);
  for (i = 1; i <= k; i++) scanf("%d", &R[i]);
  T[0] = X + 1;
  for (i = 1; i <= k; i++) {
    if (R[i] - R[i - 1] > X) b[++tot] = i;
    if (i & 1)
      s += R[i] - R[i - 1], G[i] = max(G[i - 1], s), T[i] = min(T[i - 1], s);
    else
      s -= (R[i] - R[i - 1]), G[i] = max(G[i - 1], s), T[i] = min(T[i - 1], s);
    sum[i] = s;
  }
  scanf("%d", &Q);
  for (i = 1; i <= Q; i++) {
    scanf("%d%d", &x, &y);
    int l = 1, r = tot, S = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (R[b[mid]] <= x)
        S = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    l = 1, r = k;
    int GT = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (R[mid] > x)
        r = mid - 1;
      else
        GT = mid, l = mid + 1;
    }
    l = 1, r = GT;
    int S1 = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (G[mid] > y || y > X + T[mid])
        S1 = mid, r = mid - 1;
      else
        l = mid + 1;
    }
    if (!S && !S1) {
      if (GT & 1)
        printf("%d\n", min(X, y - sum[GT] + x - R[GT]));
      else
        printf("%d\n", max(0, y - sum[GT] - x + R[GT]));
    } else {
      int st;
      if (S && !S1)
        st = S;
      else if (!S && S1)
        st = S1;
      else
        st = max(S, S1);
      if (((st + 1) & 1)) {
        if (GT & 1)
          printf("%d\n", min(X, X - (sum[GT] - sum[st]) + x - R[GT]));
        else
          printf("%d\n", max(0, X - (sum[GT] - sum[st]) - x + R[GT]));
      } else {
        if (GT & 1)
          printf("%d\n", min(X, -sum[GT] + sum[st] + x - R[GT]));
        else
          printf("%d\n", max(0, -sum[GT] + sum[st] - x + R[GT]));
      }
    }
  }
}
