#include <bits/stdc++.h>
using namespace std;
long long X, K;
long long r[100005];
long long Q;
void solve(long long t, long long a) {
  long long ans = a;
  for (long long i = 1; i <= K + 1; i++) {
    if (i % 2 == 1) {
      ans -= (min(t, r[i]) - r[i - 1]);
      if (ans < 0) ans = 0;
    } else {
      ans += (min(t, r[i]) - r[i - 1]);
      if (ans > X) ans = X;
    }
    if (t <= r[i]) {
      cout << ans << endl;
      return;
    }
  }
  cout << ans << endl;
}
signed main() {
  long long t, a;
  cin >> X >> K;
  for (long long i = 0; (i) < (K); (i)++) {
    cin >> r[i + 1];
  }
  r[0] = 0;
  r[K + 1] = 1000000009;
  cin >> Q;
  for (long long i = 0; (i) < (Q); (i)++) {
    cin >> t >> a;
    solve(t, a);
  }
  return 0;
}
