#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int INF = 0x3f3f3f3f;
int Q, n, pos;
long long X, ti, ai, ans;
long long ri[MAXN];
long long xx, yy, kk;
int main() {
  while (~scanf("%lld", &X)) {
    scanf("%d", &n);
    ri[0] = 0;
    for (int i = 1; i <= n; i++) scanf("%lld", &ri[i]);
    scanf("%d", &Q);
    pos = 1;
    while (Q--) {
      scanf("%lld %lld", &ti, &ai);
      xx = 0;
      yy = ai;
      kk = -1;
      while (pos <= n && ri[pos] <= ti) {
        yy = kk * (ri[pos] - xx) + yy;
        xx = ri[pos];
        kk *= -1;
        if (yy > X) yy = X;
        if (yy < 0) yy = 0;
        pos++;
      }
      ans = kk * (ti - xx) + yy;
      if (ans > X) ans = X;
      if (ans < 0) ans = 0;
      printf("%lld\n", ans);
    }
  }
  return 0;
}
