#include <bits/stdc++.h>
using namespace std;
int x, k, r[100005], q;
int main() {
  cin >> x >> k;
  for (int i = 1; i <= k; i++) cin >> r[i];
  cin >> q;
  while (q--) {
    int t, a;
    cin >> t >> a;
    int pos = lower_bound(r + 1, r + k + 1, t) - r;
    int cur = a, dir = -1;
    for (int i = 1; i <= pos - 1; i++) {
      cur += dir * (r[i] - r[i - 1]);
      cur = max(cur, 0);
      cur = min(cur, x);
      dir *= -1;
    }
    cur += dir * (t - r[pos - 1]);
    cur = max(cur, 0);
    cur = min(cur, x);
    cout << cur << endl;
  }
  return 0;
}
