#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int INF = 0x3f3f3f3f;
int Q, n, pos;
int X, ti, ai, ans, temp, tmp;
int ri[MAXN];
struct Node {
  int x, y, k;
} mmax[MAXN], mmin[MAXN];
int xx, yy, kk;
int main() {
  while (~scanf("%d", &X)) {
    memset(mmax, 0, sizeof(mmax));
    memset(mmin, 0, sizeof(mmin));
    scanf("%d", &n);
    ri[0] = 0;
    for (int i = 1; i <= n; i++) scanf("%d", &ri[i]);
    mmax[0].x = 0;
    mmax[0].y = X;
    mmax[0].k = -1;
    for (int i = 1; i <= n; i++) {
      mmax[i].y = mmax[i].k * (ri[i] - mmax[i - 1].x) + mmax[i - 1].y;
      mmax[i].x = ri[i];
      mmax[i].k *= -1;
      if (mmax[i].y < 0) mmax[i].y = 0;
      if (mmax[i].y > X) mmax[i].y = X;
    }
    mmin[0].x = 0;
    mmin[0].y = 0;
    mmin[0].k = -1;
    for (int i = 1; i <= n; i++) {
      mmin[i].y = mmin[i].k * (ri[i] - mmin[i - 1].x) + mmin[i - 1].y;
      mmin[i].x = ri[i];
      mmin[i].k *= -1;
      if (mmin[i].y < 0) mmin[i].y = 0;
      if (mmin[i].y > X) mmin[i].y = X;
    }
    scanf("%d", &Q);
    pos = 1;
    while (Q--) {
      scanf("%d %d", &ti, &ai);
      while (pos <= n && ri[pos] <= ti) {
        temp += (ri[pos] - ri[pos - 1]) * (pos & 1 ? -1 : 1);
        pos++;
      }
      ans = temp + ai;
      if (ans < mmin[pos - 1].y) ans = mmin[pos - 1].y;
      if (ans > mmax[pos - 1].y) ans = mmax[pos - 1].y;
      ans += (ti - ri[pos - 1]) * (pos & 1 ? -1 : 1);
      if (ans > X) ans = X;
      if (ans < 0) ans = 0;
      printf("%d\n", ans);
    }
  }
  return 0;
}
