#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 200000 + 10;
long long X, K, Q;
long long r[MAXN];
struct Fun {
  long long a, b, c;
};
Fun f[MAXN + 1];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin >> X >> K;
  vector<pair<long long, bool>> ev;
  r[0] = 0;
  ev.push_back({0, true});
  for (long long i = 0; i < K; i++) {
    cin >> r[i + 1];
    ev.push_back({r[i + 1], true});
  }
  cin >> Q;
  vector<pair<long long, long long>> queries;
  queries.resize(Q);
  for (long long i = 0; i < Q; i++) {
    cin >> queries[i].first >> queries[i].second;
    ev.push_back({queries[i].first, false});
  }
  sort(begin(ev) + 1, end(ev));
  f[0] = Fun({0, X, 0});
  bool dec = true;
  for (long long i = 1; i < ev.size(); i++) {
    long long a, b, c;
    tie(a, b, c) = make_tuple(f[i - 1].a, f[i - 1].b, f[i - 1].c);
    long long d = ev[i].first - ev[i - 1].first;
    if (dec) {
      long long m = min(a + c, d);
      c -= m;
      d -= m;
      c -= d;
      a += d;
    } else {
      long long m = min(X - (b + c), d);
      c += m;
      d -= m;
      c += d;
      b -= d;
    }
    if (ev[i].second) dec = !dec;
    f[i] = {a, b, c};
  }
  for (auto q : queries) {
    long long t = q.first;
    long long a = q.second;
    Fun fun =
        f[(lower_bound(begin(ev), end(ev), make_pair(t, false)) - begin(ev))];
    long long res;
    if (a <= fun.a)
      res = fun.a + fun.c;
    else if (a <= fun.b)
      res = a + fun.c;
    else
      res = fun.b + fun.c;
    cout << res << "\n";
  }
  return 0;
}
