#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 1;
int n, k, a[N], r[N], q0, X, pos0, r1[N], ret1[N];
struct nd {
  int a, t, id;
} q[N];
bool cmp(nd a, nd b) { return a.a < b.a; }
struct tree {
  int w[N];
  void up(int x) {
    w[x] = w[x << 1] + w[x << 1 | 1];
    w[x] = min(w[x], X);
    w[x] = max(w[x], 0);
  }
  int build(int x, int l1, int r1) {
    if (l1 == r1 && l1 == 0) pos0 = x;
    if (l1 == r1) return 0 * (w[x] = r[l1]);
    build(x << 1, l1, l1 + r1 >> 1);
    build(x << 1 | 1, (l1 + r1 >> 1) + 1, r1);
    up(x);
    return 0;
  }
  int get(int x, int l, int r, int L, int R) {
    if (L <= l && r <= R) return w[x];
    int mid = l + r >> 1, ret = 0;
    if (L <= mid) ret += get(x << 1, l, mid, L, R);
    ret = min(ret, X);
    ret = max(ret, 0);
    if (R > mid) ret += get(x << 1 | 1, mid + 1, r, L, R);
    ret = min(ret, X);
    ret = max(ret, 0);
    return ret;
  }
  void change(int x, int l, int r, int pos, int d) {
    if (l == r) {
      w[x] = d;
      return;
    }
    int mid = l + r >> 1;
    if (pos <= mid)
      change(x << 1, l, mid, pos, d);
    else
      change(x << 1 | 1, mid + 1, r, pos, d);
    up(x);
  }
} T;
int main() {
  scanf("%d%d", &X, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", r + i), r1[i] = r[i];
  for (int i = k; i >= 1; --i) r[i] -= r[i - 1];
  r[++k] = 1e9;
  for (int i = 1; i <= k; i += 2) r[i] = -r[i];
  scanf("%d", &q0);
  for (int i = 1; i <= q0; ++i) scanf("%d%d", &q[i].t, &q[i].a), q[i].id = i;
  sort(q + 1, q + q0 + 1, cmp);
  T.build(1, 0, k);
  for (int i = 1; i <= q0; ++i) {
    int t = lower_bound(r1, r1 + k + 1, q[i].t) - r1 - 1;
    T.change(1, 0, k, 0, q[i].a);
    int ans = T.get(1, 0, k, 0, t);
    if (t % 2 == 0)
      ans -= q[i].t - r1[t];
    else
      ans += q[i].t - r1[t];
    ans = min(ans, X);
    ans = max(ans, 0);
    ret1[q[i].id] = ans;
  }
  for (int i = 1; i <= q0; ++i) cout << ret1[i] << endl;
}
