#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int X, k, r[N], ans[N], m, n;
struct node {
  int L, R, tag, add;
} d[N << 2];
struct que {
  int t, a, id;
  inline bool operator<(const que& rhs) const { return t < rhs.t; }
} q[N];
vector<int> vec;
inline void update(int o) {
  d[o].L = min(d[o << 1].L, d[o << 1 | 1].L);
  d[o].R = max(d[o << 1].R, d[o << 1 | 1].R);
}
void build(int l, int r, int o) {
  if (l == r)
    d[o] = (node){vec[l], vec[r], 0, 0};
  else {
    const int mid = l + r >> 1;
    build(l, mid, o << 1), build(mid + 1, r, o << 1 | 1);
    update(o);
  }
}
inline void pushdown(int o) {
  if (d[o].tag) {
    d[o << 1].tag = d[o << 1 | 1].tag = d[o].tag;
    if (d[o].tag == -1)
      d[o << 1].L = d[o << 1].R = d[o << 1 | 1].L = d[o << 1 | 1].R = 0;
    else
      d[o << 1].L = d[o << 1].R = d[o << 1 | 1].L = d[o << 1 | 1].R = X;
    d[o].tag = 0;
  }
  if (int& x = d[o].add) {
    d[o << 1].add += x, d[o << 1 | 1].add += x;
    d[o << 1].L += x, d[o << 1 | 1].L += x;
    d[o << 1].R += x;
    d[o << 1 | 1].R += x;
    x = 0;
  }
}
int query(int l, int r, int o, const int& pos) {
  if (l == r) return d[o].L;
  pushdown(o);
  const int mid = l + r >> 1;
  if (pos <= mid) return query(l, mid, o << 1, pos);
  return query(mid + 1, r, o << 1 | 1, pos);
}
void increase(int l, int r, int o, const int& dlt) {
  if (d[o].R + dlt <= X)
    d[o].L += dlt, d[o].R += dlt, d[o].add += dlt;
  else if (d[o].L + dlt >= X)
    d[o].L = d[o].R = X, d[o].add = 0, d[o].tag = 1;
  else {
    pushdown(o);
    const int mid = l + r >> 1;
    increase(l, mid, o << 1, dlt);
    increase(mid + 1, r, o << 1 | 1, dlt);
    update(o);
  }
}
void decrease(int l, int r, int o, const int& dlt) {
  if (d[o].L >= dlt)
    d[o].L -= dlt, d[o].R -= dlt, d[o].add -= dlt;
  else if (d[o].R <= dlt)
    d[o].L = d[o].R = d[o].add = 0, d[o].tag = -1;
  else {
    pushdown(o);
    const int mid = l + r >> 1;
    decrease(l, mid, o << 1, dlt);
    decrease(mid + 1, r, o << 1 | 1, dlt);
    update(o);
  }
}
int main() {
  scanf("%d%d", &X, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", r + i);
  r[k + 1] = 1e9 + 7;
  scanf("%d", &m);
  vec.push_back(-1);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &q[i].t, &q[i].a);
    q[i].id = i;
    vec.push_back(q[i].a);
  }
  sort(vec.begin(), vec.end()),
      vec.erase(unique(vec.begin(), vec.end()), vec.end());
  n = vec.size() - 1;
  sort(q + 1, q + m + 1);
  build(1, n, 1);
  int cur = -1;
  for (int i = 1, it = 1; i <= k + 1 && it <= m; ++i) {
    while (it <= m && q[it].t <= r[i]) {
      int pos = lower_bound(vec.begin(), vec.end(), q[it].a) - vec.begin();
      int now = query(1, n, 1, pos) + cur * (q[it].t - r[i - 1]);
      if (now < 0) now = 0;
      if (now > X) now = X;
      ans[q[it++].id] = now;
    }
    if (cur == -1)
      decrease(1, n, 1, r[i] - r[i - 1]);
    else
      increase(1, n, 1, r[i] - r[i - 1]);
    cur *= -1;
  }
  for (int i = 1; i <= m; ++i) printf("%d\n", ans[i]);
  return 0;
}
