#include <bits/stdc++.h>
int X, n, v, k, Q;
bool sx = 1;
struct shalou {
  int t;
  int va;
};
struct xunwen {
  int aq;
  int tq;
  int ans;
};
xunwen *x;
shalou *s;
int main() {
  freopen("c.in", "r", stdin);
  freopen("c.out", "w", stdout);
  scanf("%d%d", &X, &n);
  s = new shalou[n + 1];
  for (int i = 1; i <= n; i++) scanf("%d", &s[i].t);
  scanf("%d", &Q);
  x = new xunwen[Q + 1];
  for (int i = 1; i <= Q; i++) scanf("%d%d", &x[i].tq, &x[i].aq);
  s[0].t = 0;
  for (int i = 1; i <= Q; i++) {
    s[0].va = x[i].aq;
    int j = 1;
    while (x[i].tq > s[j].t) j++;
    for (k = 1; k < j; k++) {
      if (sx == 1) {
        s[k].va = s[k - 1].va - (s[k].t - s[k - 1].t);
        if (s[k].va < 0) s[k].va = 0;
        sx = 0;
      } else {
        s[k].va = s[k - 1].va + (s[k].t - s[k - 1].t);
        if (s[k].va > X) s[k].va = X;
        sx = 1;
      }
    }
    if (sx == 1) {
      x[i].ans = s[k - 1].va - (x[i].tq - s[k - 1].t);
      if (x[i].ans < 0) x[i].ans = 0;
    } else {
      x[i].ans = s[k - 1].va + (x[i].tq - s[k - 1].t);
      if (x[i].ans > X) x[i].ans = X;
      sx = 1;
    }
    printf("%d\n", x[i].ans);
  }
  return 0;
}
