#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
signed main() {
  long long x, k;
  cin >> x >> k;
  vector<long long> r(k);
  for (long long &p : r) cin >> p;
  r.push_back(LINF);
  long long q;
  cin >> q;
  vector<pair<long long, long long> > qu(q);
  for (pair<long long, long long> &p : qu) {
    long long t, a;
    cin >> t >> a;
    p = pair<long long, long long>(t, a);
  }
  long long now = 0, de = 0, fl = 1, low = 0, high = x;
  long long A = x;
  for (pair<long long, long long> _ : qu) {
    long long t = _.first, a = _.second;
    while (now <= k && r[now] <= t) {
      de += fl * (r[now] - (now > 0 ? r[now - 1] : 0));
      chmin(high, x + de);
      chmax(low, de);
      fl *= -1;
      now++;
    }
    long long ans, w = -de - fl * (t - (now ? r[now - 1] : 0));
    if (a < low)
      ans = low + w;
    else if (a > high)
      ans = high + w;
    else
      ans = a + w;
    if (high < low) ans = de + w;
    if (ans < 0) ans = 0;
    if (ans > x) ans = x;
    cout << ans << endl;
  }
}
