#include <bits/stdc++.h>
using namespace std;
long long x, k, Q;
long long r[100005];
long long t[100005], a[100005];
long long low[100005], high[100005], pos[100005];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> x >> k;
  for (int i = 1; i <= k; i++) cin >> r[i];
  cin >> Q;
  for (int i = 1; i <= Q; i++) cin >> t[i] >> a[i];
  long long ub = x, lb = 0, hi = x, lo = 0;
  pos[0] = 0, low[0] = lo, high[0] = hi;
  for (int i = 1; i <= k; i++) {
    long long dif = r[i] - r[i - 1];
    if (i % 2) {
      ub -= dif, lb -= dif;
      if (lb < 0) lo += -lb, lb = 0;
    } else {
      ub += dif, lb += dif;
      if (ub > x) hi -= ub - x, ub = x;
    }
    pos[i] = lb, low[i] = lo, high[i] = hi;
  }
  long long ans;
  for (int i = 1; i <= Q; i++) {
    long long p = upper_bound(r, r + k + 1, t[i]) - r - 1;
    if (high[p] <= low[p])
      ans = pos[p];
    else if (a[i] <= low[p])
      ans = pos[p];
    else if (a[i] >= high[p])
      ans = pos[p] + (high[p] - low[p]);
    else
      ans = pos[p] + a[i] - low[p];
    long long dif = t[i] - r[p];
    if ((p + 1) % 2) {
      ans -= dif;
      ans = max(ans, 0LL);
    } else {
      ans += dif;
      ans = min(ans, x);
    }
    cout << ans << endl;
  }
  return 0;
}
