#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int mx[maxn << 2], mn[maxn << 2];
bool rev[maxn << 2];
int r[maxn], a[maxn], t[maxn], b[maxn], val[maxn], add[maxn], all[maxn];
map<int, int> ma;
int ql, qr, x;
void maintain(int o) {
  mn[o] = min(mn[o << 1], mn[o << 1 | 1]);
  mx[o] = max(mx[o << 1], mx[o << 1 | 1]);
}
void flip(int o) {
  rev[o] ^= 1;
  if (all[o] != -1) {
    all[o] = x - all[o];
    rev[o] = 0;
  } else
    add[o] *= -1;
  int t1 = mx[o], t2 = mn[o];
  mx[o] = x - t2;
  mn[o] = x - t1;
}
void pushdown(int o) {
  if (!rev[o]) {
    if (all[o] != -1) {
      all[o << 1] = all[o];
      add[o << 1] = 0;
      mx[o << 1] = mn[o << 1] = all[o];
      rev[o << 1] = 0;
      all[o << 1 | 1] = all[o];
      add[o << 1 | 1] = 0;
      mx[o << 1 | 1] = mn[o << 1 | 1] = all[o];
      rev[o << 1 | 1] = 0;
      all[o] = -1;
    } else {
      if (all[o << 1] != -1) {
        all[o << 1] += add[o];
        mx[o << 1] += add[o];
        mn[o << 1] += add[o];
      } else {
        add[o << 1] += add[o];
        mx[o << 1] += add[o];
        mn[o << 1] += add[o];
      }
      if (all[o << 1 | 1] != -1) {
        all[o << 1 | 1] += add[o];
        mx[o << 1 | 1] += add[o];
        mn[o << 1 | 1] += add[o];
      } else {
        add[o << 1 | 1] += add[o];
        mx[o << 1 | 1] += add[o];
        mn[o << 1 | 1] += add[o];
      }
      add[o] = 0;
    }
  } else {
    flip(o << 1);
    flip(o << 1 | 1);
    if (add[o]) {
      if (all[o << 1] != -1) {
        all[o << 1] += add[o];
      } else
        add[o << 1] += add[o];
      if (all[o << 1 | 1] != -1) {
        all[o << 1 | 1] += add[o];
      } else {
        add[o << 1 | 1] += add[o];
      }
      mn[o << 1] += add[o];
      mx[o << 1] += add[o];
      mn[o << 1 | 1] += add[o];
      mx[o << 1 | 1] += add[o];
      add[o] = 0;
    }
    rev[o] = 0;
  }
}
void build(int o, int l, int r) {
  rev[o] = 0;
  add[o] = 0;
  all[o] = -1;
  if (l == r) {
    mx[o] = mn[o] = b[l];
  } else {
    int mid = (l + r) >> 1;
    build(o << 1, l, mid);
    build(o << 1 | 1, mid + 1, r);
    maintain(o);
  }
}
void update(int o, int l, int r) {
  pushdown(o);
  if (mx[o] <= qr) {
    all[o] = mn[o] = mx[o] = add[o] = rev[o] = 0;
    return;
  }
  if (mn[o] >= qr) {
    if (all[o] != -1) {
      all[o] -= qr;
      mn[o] -= qr;
      mx[o] -= qr;
    } else {
      add[o] -= qr;
      mn[o] -= qr;
      mx[o] -= qr;
    }
    return;
  }
  int mid = (l + r) >> 1;
  update(o << 1, l, mid);
  update(o << 1 | 1, mid + 1, r);
  if (l != r) maintain(o);
}
int query(int o, int l, int r) {
  if (l == r && qr == l)
    return mx[o];
  else {
    pushdown(o);
    int mid = (l + r) >> 1;
    int ans;
    if (qr > mid)
      ans = query(o << 1 | 1, mid + 1, r);
    else
      ans = query(o << 1, l, mid);
    maintain(o);
    return ans;
  }
}
int main() {
  int k, q;
  int i, j;
  scanf("%d %d", &x, &k);
  for (i = 1; i <= k; i++) {
    scanf("%d", &r[i]);
  }
  scanf("%d", &q);
  for (i = 1; i <= q; i++) {
    scanf("%d %d", &t[i], &a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + 1 + q);
  int m = unique(b + 1, b + 1 + q) - b - 1;
  ma.clear();
  for (i = 1; i <= m; i++) ma[b[i]] = i;
  build(1, 1, m);
  j = 0;
  r[0] = 0;
  for (i = 1; i <= k; i++) {
    while (j < q && t[j + 1] <= r[i]) {
      j++;
      ql = qr = ma[a[j]];
      int ans = query(1, 1, m);
      if (t[j] - r[i - 1] >= ans)
        ans = 0;
      else
        ans -= t[j] - r[i - 1];
      if ((i & 1) == 0) ans = x - ans;
      printf("%d\n", ans);
    }
    ql = 0;
    qr = r[i] - r[i - 1];
    update(1, 1, m);
    pushdown(1);
    maintain(1);
    flip(1);
  }
  while (j < q) {
    j++;
    ql = qr = ma[a[j]];
    int ans = query(1, 1, m);
    if (t[j] - r[k] >= ans)
      ans = 0;
    else
      ans -= t[j] - r[i - 1];
    if (((k + 1) & 1) == 0) ans = x - ans;
    printf("%d\n", ans);
  }
  return 0;
}
