#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long x;
  cin >> x;
  long long k;
  cin >> k;
  priority_queue<pair<long long, long long>> pq;
  for (int i = 0; i < k; ++i) {
    long long r;
    cin >> r;
    pq.emplace(-r, -1);
  }
  long long q;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    long long t, a;
    cin >> t >> a;
    pq.emplace(-t, a);
  }
  long long lb = 0, ub = x, offset = 0;
  long long cur = 0, d = -1, prev_t = 0;
  while (not pq.empty()) {
    auto tup = pq.top();
    pq.pop();
    const long long t = -tup.first;
    const long long query = tup.second;
    cur += (t - prev_t) * d;
    lb = max(lb, -cur);
    ub = min(ub, x - cur);
    offset += (t - prev_t) * d;
    offset = min(offset, x);
    offset = max(offset, 0LL);
    if (query == -1) {
      d *= -1;
    } else {
      const long long a = query;
      long long ans;
      if (a <= lb) {
        ans = offset;
      } else if (a <= ub) {
        ans = offset + (a - lb);
      } else {
        ans = offset + (ub - lb);
      }
      cout << ans << endl;
    }
    prev_t = t;
  }
  return 0;
}
