#include <bits/stdc++.h>
using namespace std;
const long long INF = LONG_MAX;
const double EPS = 0.00001;
const long double PI = acos(-1.0);
int main() {
  long long X, K, Q;
  cin >> X >> K;
  vector<long long> r(K);
  for (long long i = (0); i < (K); ++i) cin >> r[i];
  cin >> Q;
  for (long long i = (0); i < (Q); ++i) {
    long long t, a;
    cin >> t >> a;
    auto itr = lower_bound(r.begin(), r.end(), t);
    int pos = itr - r.begin();
    long long ue = a;
    for (long long j = (0); j < (pos); ++j) {
      if (j == 0)
        ue = max(0LL, ue - r[j]);
      else
        ue = max(0LL, ue - (r[j] - r[j - 1]));
      ue = X - ue;
    }
    if (pos != 0) t -= r[pos - 1];
    ue = max(0LL, ue - t);
    if (pos % 2)
      cout << X - ue << endl;
    else
      cout << ue << endl;
  }
  return 0;
}
