#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
const int64_t mod = 1e9 + 7;
int main() {
  int k, q;
  int64_t x;
  cin >> x >> k;
  vector<int64_t> r(k);
  for (int(i) = 0; (i) < (k); (i)++) cin >> r[i];
  cin >> q;
  for (int(zx) = 0; (zx) < (q); (zx)++) {
    int64_t a, t;
    int ct = 0;
    cin >> t >> a;
    int64_t cr = 0;
    for (int(j) = 0; (j) < (k); (j)++) {
      if (r[j] > t) break;
      if (cr <= r[j]) {
        if (!(j & 1)) {
          a -= r[j] - cr;
        } else {
          a += r[j] - cr;
        }
        if (a < 0) a = 0;
        if (a > x) a = x;
        cr = r[j];
        ct++;
      }
    }
    int64_t sm = (ct & 1) ? a - cr + t : a - t + cr;
    if (sm < 0) sm = 0;
    if (sm > x) sm = x;
    cout << sm << "\n";
  }
  return 0;
}
