#include <bits/stdc++.h>
using namespace std;
int x, n, q, t, k, r[100005], turn[100005], a[100005];
pair<int, int> St[100005 << 3];
pair<int, int> f(pair<int, int> x, pair<int, int> y) {
  pair<int, int> res =
      make_pair(min(x.first, y.first), max(x.second, y.second));
  return res;
}
pair<int, int> get(int node, int bas, int son, int q, int w) {
  if (!q || q > w) return make_pair(0, 0);
  if (bas > w || son < q) return make_pair(2000000000, -2000000000);
  if (bas >= q && son <= w) return St[node];
  int orta = (bas + son) / 2;
  return f(get(node * 2, bas, orta, q, w),
           get(node * 2 + 1, orta + 1, son, q, w));
}
void build(int node, int bas, int son) {
  if (bas == son) {
    St[node] = make_pair(a[bas], a[son]);
    return;
  }
  int orta = (bas + son) / 2;
  build(node * 2, bas, orta);
  build(node * 2 + 1, orta + 1, son);
  St[node] = f(St[node * 2], St[node * 2 + 1]);
}
int main() {
  scanf("%d %d", &x, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &r[i]);
  }
  sort(r + 1, r + 1 + n);
  turn[0] = 1;
  for (int i = 1; i <= n; i++) {
    turn[i] = -turn[i - 1];
    a[i] = a[i - 1] + turn[i] * (r[i] - r[i - 1]);
  }
  turn[n + 1] = -turn[n];
  build(1, 1, n);
  scanf("%d", &q);
  while (q--) {
    scanf("%d %d", &t, &k);
    int bas = 1, son = n;
    while (bas <= son) {
      int orta = (bas + son) / 2;
      if (r[orta] > t)
        son = orta - 1;
      else
        bas = orta + 1;
    }
    pair<int, int> res = get(1, 1, n, 1, son);
    res.first += k;
    res.second += k;
    pair<int, int> va = get(1, 1, n, son, son);
    int val = va.first + k;
    int last = val + (t - r[son]) * turn[son + 1];
    res.first = min(res.first, last);
    res.second = max(res.second, last);
    printf("%d\n", min(last - max(0, (res.second - x)) - min(0, res.first), x));
  }
}
