#include <bits/stdc++.h>
using namespace std;
int x, k, r[100010], q, nT;
int pref[100010], nxt[100010][20];
struct node {
  int l, r, m, mi, ma;
  node *lch, *rch;
  node() {}
  node(int L, int R) : l(L), r(R) {
    m = (l + r) >> 1;
    lch = rch = NULL;
  }
} pn[200010], *root;
void build(node *p) {
  if (p->r - p->l == 1) {
    p->mi = p->ma = pref[p->l];
    return;
  }
  p->lch = &(pn[nT++] = node(p->l, p->m));
  build(p->lch);
  p->rch = &(pn[nT++] = node(p->m, p->r));
  build(p->rch);
  p->ma = max(p->lch->ma, p->rch->ma);
  p->mi = min(p->lch->mi, p->rch->mi);
}
int qmax(node *p, int l, int r) {
  if (r <= p->l || p->r <= l) return 0;
  if (l <= p->l && p->r <= r) return p->ma;
  return max(qmax(p->lch, l, r), qmax(p->rch, l, r));
}
int qmin(node *p, int l, int r) {
  if (r <= p->l || p->r <= l) return 0;
  if (l <= p->l && p->r <= r) return p->mi;
  return min(qmin(p->lch, l, r), qmin(p->rch, l, r));
}
int p(int off, int st) {
  int l = st + 1, r = k + 1, m;
  if (off + pref[l] - pref[st] < 0 || off + pref[l] - pref[st] > x) return l;
  while (r - l > 1) {
    m = (l + r) >> 1;
    if (off + (qmin(root, st + 1, m + 1) - pref[st]) < 0 ||
        off + (qmax(root, st + 1, m + 1) - pref[st]) > x)
      r = m;
    else
      l = m;
  }
  return r;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> x >> k;
  for (int i = 1; i <= k; i++) {
    cin >> r[i];
    pref[i] = pref[i - 1] - ((i & 1) ? 1 : -1) * (r[i] - r[i - 1]);
  }
  r[k + 1] = 0x3f3f3f3f;
  root = &(pn[nT++] = node(1, k + 1));
  build(root);
  for (int i = 1; i <= k; i++) nxt[i][0] = p(((i & 1) ^ 1) * x, i);
  nxt[k + 1][0] = k + 1;
  for (int i = 1; i <= 17; i++)
    for (int j = 1; j <= k + 1; j++) nxt[j][i] = nxt[nxt[j][i - 1]][i - 1];
  cin >> q;
  int a, t;
  while (q--) {
    cin >> t >> a;
    int o = p(a, 0);
    int tp = lower_bound(r, r + k + 1, t) - r - 1;
    if (r[o] > t) {
      cout << max(0, a + pref[tp] + (t - r[tp]) * ((tp & 1) ? 1 : -1)) << endl;
      continue;
    }
    for (int i = 17; ~i; i--)
      if (r[nxt[o][i]] <= t) o = nxt[o][i];
    int ans = ((o & 1) ? 0 : x) + pref[tp] - pref[o] +
              (t - r[tp]) * ((tp & 1) ? 1 : -1);
    ans = max(ans, 0);
    ans = min(ans, x);
    cout << ans << endl;
  }
  return 0;
}
