#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long INF = 1e9;
signed main() {
  long long x, k;
  cin >> x >> k;
  vector<long long> r(k + 1, 0);
  for (long long i = 1; i < k + 1; i++) {
    cin >> r[i];
  }
  k++;
  vector<long long> dr(k);
  dr[0] = 0;
  vector<long long> dm(k);
  vector<long long> df(k);
  df[0] = 0;
  for (long long(i) = (1); i < (k); (i)++) {
    dr[i] = min(x, r[i] - r[i - 1]);
    df[i] = df[i - 1] + (i % 2 ? -1 : +1) * dr[i];
    dm[i] = dr[i] - dr[i - 1];
  }
  vector<pair<long long, long long> > ud(k);
  vector<pair<long long, long long> > dd(k);
  ud[0].first = x;
  ud[0].second = 0;
  dd[0].first = 0;
  dd[0].second = x;
  for (long long(i) = (1); i < (k); (i)++) {
    ud[i] = ud[i - 1];
    dd[i] = dd[i - 1];
    if (i % 2 == 0) {
      {
        long long df = min(dr[i], ud[i].second);
        ud[i].first += df;
        ud[i].second -= df;
      }
      {
        long long df = min(dr[i], dd[i].second);
        dd[i].first += df;
        dd[i].second -= df;
      }
    } else {
      {
        long long df = min(dr[i], ud[i].first);
        ud[i].first -= df;
        ud[i].second += df;
      }
      {
        long long df = min(dr[i], dd[i].first);
        dd[i].first -= df;
        dd[i].second += df;
      }
    }
  }
  map<long long, long long> tmp;
  for (long long(i) = (0); i < (k); (i)++) {
    tmp[r[i]] = i;
  }
  map<long long, long long> mpA, mpB;
  for (long long(i) = (0); i < (k); (i)++) {
    if (i % 2 == 1 && (mpA.size() == 0 || prev(mpA.end())->first < dm[i])) {
      mpA[dm[i]] = i;
    }
    if (i % 2 == 0 && (mpB.size() == 0 || prev(mpB.end())->first < dm[i])) {
      mpB[dm[i]] = i;
    }
  }
  long long q;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    long long t, a;
    cin >> t >> a;
    long long b = x - a;
    long long rt = prev(tmp.upper_bound(t))->first;
    long long ti = prev(tmp.upper_bound(t))->second;
    long long dt = (t - rt) * (ti % 2 ? +1 : -1);
    long long left = INF;
    long long la, lb;
    if (mpA.lower_bound(a) != mpA.end()) {
      left = mpA.lower_bound(a)->second;
      la = 0;
      lb = x;
    }
    if (mpB.lower_bound(b) != mpB.end()) {
      left = mpB.lower_bound(b)->second;
      la = x;
      lb = 0;
    }
    long long ans;
    if (ti < left) {
      ans = a + df[ti] + dt;
    } else if (la == ud[left].first && lb == ud[left].second) {
      ans = ud[ti].first + dt;
    } else if (la == dd[left].first && lb == dd[left].second) {
      ans = dd[ti].first + dt;
    }
    cout << max(0ll, min(x, ans)) << endl;
  }
  return 0;
}
