#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int key[N], ls[N], rs[N], fa[N], val[N], lim, k, r[N], st[N],
    tp = 0, q, t[N], a[N], cov[N], add[N], rt = 0, tt = 0, ans[N];
bool flip[N];
vector<int> qry[N];
int newnode(int x) {
  ++tt;
  val[tt] = x;
  cov[tt] = -1;
  add[tt] = 0;
  return tt;
}
void cover(int x, int v) {
  add[x] = 0;
  cov[x] = val[x] = v;
}
void mdf(int x, int v) { val[x] += v, add[x] += v; }
void down(int x) {
  if (~cov[x]) cover(ls[x], cov[x]), cover(rs[x], cov[x]), cov[x] = -1;
  if (add[x]) mdf(ls[x], add[x]), mdf(rs[x], add[x]), add[x] = 0;
}
int merge(int a, int b) {
  if (!a || !b) return a | b;
  if (key[a] < key[b]) {
    down(a);
    rs[a] = merge(rs[a], b);
    fa[rs[a]] = a;
    return a;
  } else {
    down(b);
    ls[b] = merge(a, ls[b]);
    fa[ls[b]] = b;
    return b;
  }
}
pair<int, int> split(int x, int v) {
  if (!x) return make_pair(0, 0);
  pair<int, int> y;
  down(x);
  if (val[x] > v) {
    y = split(ls[x], v);
    ls[x] = y.second;
    fa[y.second] = x;
    y.second = x;
  } else {
    y = split(rs[x], v);
    rs[x] = y.first;
    fa[y.first] = x;
    y.first = x;
  }
  return y;
}
void pushall(int x) {
  if (fa[x]) pushall(fa[x]);
  down(x);
}
int find(int x) { return lower_bound(st + 1, st + tp + 1, x) - st; }
void insert(int v) {
  pair<int, int> x = split(rt, v);
  rt = merge(x.first, merge(newnode(v), x.second));
}
int main() {
  cin >> lim >> k;
  for (int i = 1; i <= k; i++) st[++tp] = r[i] = gi();
  cin >> q;
  for (int i = 1; i <= q; i++) st[++tp] = t[i] = gi(), a[i] = gi();
  sort(st + 1, st + tp + 1);
  tp = unique(st + 1, st + tp + 1) - st - 1;
  for (int i = 1; i <= k; i++) flip[find(r[i])] = 1;
  for (int i = 1; i <= q; i++)
    qry[find(t[i])].push_back(i), insert(a[i]), fa[rt] = 0;
  bool fl = 0;
  for (int i = 1; i <= tp; i++) {
    int d = st[i] - st[i - 1];
    if (fl) {
      pair<int, int> x = split(rt, lim - d);
      mdf(x.first, d), cover(x.second, lim);
      rt = merge(x.first, x.second);
      fa[rt] = 0;
    } else {
      pair<int, int> x = split(rt, d);
      cover(x.first, 0);
      mdf(x.second, -d);
      rt = merge(x.first, x.second);
      fa[rt] = 0;
    }
    fl ^= flip[i];
    for (auto x : qry[i]) pushall(x), ans[x] = val[x];
  }
  for (int i = 1; i <= q; i++) cout << ans[i] << '\n';
  return 0;
}
