#include <bits/stdc++.h>
using namespace std;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
int main() {
  long long x;
  long long k;
  cin >> x >> k;
  vector<long long> r(k);
  for (int i = 0; i < k; i++) cin >> r[i];
  long long q;
  cin >> q;
  vector<pair<long long, pair<long long, long long>>> p;
  for (int i = 0; i < q; i++) {
    long long t, a;
    cin >> t >> a;
    p.push_back(make_pair(a, make_pair(t, i)));
  }
  sort(p.begin(), p.end());
  for (int i = 1; i < q; i++) p[i].first -= p[0].first;
  long long posx = 0;
  long long posy = p[0].first;
  vector<long long> sum(k, 0);
  vector<long long> depth(k, 0);
  for (int i = 0; i < k; i++) {
    long long d = r[i] - posx;
    if (i & 1) {
      posy += d;
      depth[i] = posy;
      sum[i] = sum[i - 1];
      posx = r[i];
    } else {
      posy -= d;
      depth[i] = posy;
      if (posy < 0) {
        sum[i] += posy + (i == 0 ? 0 : sum[i - 1]);
        posy = 0;
      } else {
        sum[i] = sum[i - 1];
      }
    }
    posx = r[i];
  }
  vector<long long> ans(q);
  for (int i = 0; i < p.size(); i++) {
    long long T = p[i].second.first;
    long long idx = p[i].second.second;
    long long D = p[i].first;
    auto it = upper_bound(r.begin(), r.end(), T - 1);
    long long pl = it - r.begin();
    long long apos;
    if (pl % 2 == 0) {
      apos = depth[pl];
      apos -= T - r[pl];
      long long add = min(0LL, apos);
      apos = max(0LL, apos);
      long long diff = max(0LL, D - sum[pl] + add);
      ans[idx] = min(x, apos + diff);
    } else {
      apos = T - r[pl];
      long long diff = max(0LL, D - sum[pl]);
      ans[idx] = min(x, apos + diff);
    }
  }
  for (int i = 0; i < q; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
