#include <bits/stdc++.h>
using namespace std;
long long int X, K, r[114514], Q, t, a, b, bf, af, i, j, pj;
pair<long long, long long> ps[4];
int main() {
  scanf("%lld%lld", &X, &K);
  for (; ++i <= K;) {
    scanf("%lld", r + i);
  }
  ps[0] = ps[1] = {0, 0};
  ps[2] = ps[3] = {X, X};
  scanf("%lld", &Q);
  for (i = 0; i < Q; ++i) {
    scanf("%lld%lld", &t, &a);
    pj = j;
    j = upper_bound(r, r + K + 1, t) - r;
    for (int k = pj; k < j; ++k) {
      ps[0] = {ps[0].first,
               ps[0].second + (r[k] - r[k - 1]) * (k & 1 ? -1 : 1)};
      ps[1] = {ps[1].first,
               ps[1].second + (r[k] - r[k - 1]) * (k & 1 ? -1 : 1)};
      ps[2] = {ps[2].first,
               ps[2].second + (r[k] - r[k - 1]) * (k & 1 ? -1 : 1)};
      ps[3] = {ps[3].first,
               ps[3].second + (r[k] - r[k - 1]) * (k & 1 ? -1 : 1)};
      ps[0].second = max(0LL, ps[0].second);
      ps[3].second = min(X, ps[3].second);
      if (ps[1].second < 0) {
        ps[1] = {ps[1].first - ps[1].second, 0};
      }
      if (ps[2].second > X) {
        ps[2] = {ps[2].first - ps[2].second + X, X};
      }
    }
    b = lower_bound(ps, ps + 4, make_pair(a, 0LL)) - ps;
    if (ps[b].first != a) {
      af = (ps[b - 1].second * (ps[b].first - a) +
            ps[b].second * (a - ps[b - 1].first)) /
           (ps[b].first - ps[b - 1].first);
    } else {
      af = ps[b].second;
    }
    cout << max(0LL, min(X, af + (t - r[j - 1]) * (j & 1 ? -1 : 1))) << endl;
  }
  return 0;
}
