#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to;
  long long cost;
};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, k, q, t, a;
  cin >> x >> k;
  vector<int> r(k), rr(k);
  for (int i = 0; i < k; i++) {
    cin >> r[i];
    if (i == 0)
      rr[0] = -r[i];
    else {
      rr[i] = r[i] - r[i - 1];
      if (i % 2 == 0) rr[i] *= -1;
    }
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> t >> a;
    int ans = a;
    if (t >= r[0]) {
      int ri = -1;
      for (int j = 0; j < k; j++) {
        if (r[j] > t) {
          ri = j;
          break;
        }
        ans = min(x, max(0, ans + rr[j]));
      }
      if (ri == -1) ri = k;
      if (ri % 2 == 1) {
        ans = min(x, ans + t - r[ri - 1]);
      } else {
        ans = max(0, ans - (t - r[ri - 1]));
      }
    } else {
      ans = max(a - t, 0);
    }
    cout << ans << endl;
  }
}
