#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
const int INF = 0x3f3f3f3f;
template <class T>
bool gmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool gmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
int n, q, t, a, r[MAX], X;
int main() {
  scanf("%d%d", &X, &n);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  scanf("%d", &q);
  long long minsand = 0, maxsand = X, val = 0, k = 1, sign = -1;
  while (q--) {
    scanf("%d%d", &t, &a);
    while (k <= n && r[k] <= t) {
      long long v = sign * (r[k] - r[k - 1]);
      minsand += v;
      maxsand += v;
      val += v;
      gmax(minsand, 0ll);
      gmin(maxsand, (long long)X);
      sign *= -1;
      k++;
    }
    long long now = val + a;
    gmax(now, minsand);
    gmin(now, maxsand);
    now += sign * (t - r[k - 1]);
    gmax(now, 0ll);
    gmin(now, (long long)X);
    printf("%lld\n", now);
  }
}
