#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int x, k, q;
int a[maxn], b[maxn], c[maxn], r[maxn];
int main() {
  scanf("%d%d", &x, &k);
  for (int(i) = 1; (i) <= k; i++) scanf("%d", &r[i]);
  b[0] = x;
  for (int(i) = 1; (i) <= k; i++) {
    a[i] = a[i - 1];
    b[i] = b[i - 1];
    if (i & 1) {
      a[i] = max(a[i], min(r[i] - r[i - 1] - c[i - 1], b[i]));
      c[i] = max(a[i - 1] + c[i - 1] - r[i] + r[i - 1], 0) - a[i];
    } else {
      b[i] = min(b[i], max(x - (r[i] - r[i - 1]) - c[i - 1], a[i]));
      c[i] = min(b[i - 1] + c[i - 1] + r[i] - r[i - 1], x) - b[i];
    }
  }
  scanf("%d", &q);
  while (q--) {
    int t, ini;
    scanf("%d%d", &t, &ini);
    int pos = upper_bound(r + 1, r + 1 + k, t) - r - 1, ans = c[pos];
    if (ini <= a[pos])
      ans += a[pos];
    else if (ini >= b[pos])
      ans += b[pos];
    else
      ans += ini;
    if (pos & 1)
      ans = min(x, ans + (t - r[pos]));
    else
      ans = max(0, ans - (t - r[pos]));
    printf("%d\n", ans);
  }
  return 0;
}
