#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (auto&& x : vec) is >> x;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  for (long long i = (0), __last_i = (vec.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << vec[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& vec) {
  for (long long i = (0), __last_i = (vec.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << vec[i];
  }
  return os;
}
class MaxFinder {
  set<pair<long long, long long>> s;

 public:
  MaxFinder() {}
  void add(long long x, long long v) {
    auto it = s.end();
    while (it != s.begin()) {
      --it;
      if (it->first < x) break;
      it = s.erase(it);
    }
    s.insert(pair<long long, long long>(x, v));
  }
  long long find(long long x) {
    auto it = s.lower_bound(pair<long long, long long>(x, -linf));
    if (it == s.end()) return -linf;
    return it->second;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long X, K;
  cin >> X >> K;
  vector<long long> r(K);
  cin >> r;
  long long Q;
  cin >> Q;
  vector<tuple<long long, long long, long long>> q;
  for (long long i = (0), __last_i = (Q); i < __last_i; i++) {
    long long t, a;
    cin >> t >> a;
    q.push_back(tuple<long long, long long, long long>(t, a, i));
  }
  sort((q).begin(), (q).end());
  vector<long long> ans(Q, -1);
  long long rp = 0;
  MaxFinder maxu, maxd;
  vector<long long> h(K + 1, 0);
  auto f = [&](long long t, long long a, bool f = false) {
    long long pos = -linf;
    pos = max(pos, maxd.find(a));
    pos = max(pos, maxu.find(-a));
    long long h0 = a + h[rp];
    if (pos >= 0) {
      h0 = pos % 2 == 0 ? 0 : X;
      h0 += h[rp] - h[pos + 1];
    }
    if (rp > 0) {
      t -= r[rp - 1];
    }
    return h0 + t * (rp % 2 == 0 ? -1 : 1);
  };
  for (auto&& query : q) {
    long long t, a, idx;
    tie(t, a, idx) = query;
    while (rp < K && t >= r[rp]) {
      if (rp % 2 == 0) {
        long long lb = -1, ub = X + 1;
        for (long long t = (0), __last_t = (30); t < __last_t; t++) {
          long long m = (lb + ub) / 2;
          if (f(r[rp], m) <= 0) {
            lb = m;
          } else {
            ub = m;
          }
        }
        maxd.add(lb, rp);
      } else {
        long long lb = -1, ub = X + 1;
        for (long long t = (0), __last_t = (30); t < __last_t; t++) {
          long long m = (lb + ub) / 2;
          if (f(r[rp], m) >= X) {
            ub = m;
          } else {
            lb = m;
          }
        }
        maxu.add(-ub, rp);
      }
      long long d = rp == 0 ? r[0] : r[rp] - r[rp - 1];
      h[rp + 1] = h[rp] + (rp % 2 == 0 ? -1 : 1) * d;
      ++rp;
    }
    ans[idx] = max(0LL, min(X, f(t, a, true)));
  }
  for (long long i = (0), __last_i = (Q); i < __last_i; i++)
    cout << ans[i] << endl;
}
