#include <bits/stdc++.h>
using namespace std;
struct data {
  int t, a, id;
  data() {}
  data(int tt, int aa, int ii) {
    t = tt;
    a = aa;
    id = ii;
  }
  bool operator<(const data &d) const { return t < d.t; }
};
int x, k, q;
int r[100005];
data d[100005];
int res[100005];
int main(void) {
  scanf("%d", &x);
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &r[i]);
  }
  r[k] = 1000000001;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &d[i].t, &d[i].a);
    d[i].id = i;
  }
  sort(d, d + q);
  int minix = 0, miniv = 0, maxix = x, maxiv = x;
  int l = 0;
  int prev = 0;
  for (int i = 0; i <= k; i++) {
    int cost = r[i] - prev;
    while (l < q && d[l].t <= r[i]) {
      int now = miniv + (d[l].a - minix);
      if (d[l].a <= minix) {
        now = miniv;
      }
      if (d[l].a >= maxix) {
        now = maxiv;
      }
      if (i % 2 == 0) {
        res[d[l].id] = max(0, now - (d[l].t - prev));
      } else {
        res[d[l].id] = min(x, now + (d[l].t - prev));
      }
      l++;
    }
    if (i % 2 == 0) {
      if (miniv <= cost) {
        minix += cost - miniv;
        minix = min(minix, x);
        miniv = 0;
      } else {
        miniv -= cost;
      }
      if (maxiv <= cost) {
        maxix += cost - miniv;
        maxix = min(maxix, x);
        maxix = min(maxix, minix);
        maxiv = 0;
      } else {
        maxiv -= cost;
      }
    } else {
      if (miniv + cost >= x) {
        minix = x;
        miniv = x;
      } else {
        miniv += cost;
      }
      if (maxiv + cost >= x) {
        maxix += (x - cost - maxiv);
        maxix = max(maxix, 0);
        maxix = min(maxix, minix);
        maxiv = x;
      } else {
        maxiv += cost;
      }
    }
    prev = r[i];
  }
  for (int i = 0; i < q; i++) {
    printf("%d\n", res[i]);
  }
  return 0;
}
