#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const double eps = 1e-10;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
int updown[2] = {-1, 1};
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll X, K;
  ll r[114514] = {};
  ll sum[114514] = {};
  ll sum_z[114514] = {}, sum_x[114514] = {};
  pair<ll, ll> lim[114514];
  cin >> X >> K;
  lim[0] = {0, X};
  sum[0] = 0;
  r[0] = 0;
  sum_x[0] = X;
  int up = X, down = 0;
  for (int i = 0; i < (K); i++) {
    cin >> r[i + 1];
    up += (r[i + 1] - r[i]) * (i * 2 ? 1 : -1);
    down += (r[i + 1] - r[i]) * (i * 2 ? 1 : -1);
    int ch_x = (up >= X ? up - X : 0);
    int ch_y = (down <= 0 ? -down : 0);
    chmin(up, X);
    chmax(down, 0);
    sum[i + 1] = sum[i] + (r[i + 1] - r[i]) * (i % 2 ? 1 : -1);
    sum_z[i + 1] =
        min(max(sum_z[i] + (r[i + 1] - r[i]) * (i % 2 ? 1 : -1), (ll)0), (ll)X);
    sum_x[i + 1] =
        min(max(sum_x[i] + (r[i + 1] - r[i]) * (i % 2 ? 1 : -1), (ll)0), (ll)X);
    lim[i + 1] = {lim[i].first + ch_y, lim[i].second - ch_x};
  }
  cout << endl;
  int Q;
  cin >> Q;
  int in = 0;
  for (int i = 0; i < (Q); i++) {
    int t, a;
    cin >> t >> a;
    while (in + 1 < K + 1 && r[in + 1] <= t) in++;
    if (lim[in].first <= a && a <= lim[in].second) {
      cout << max((ll)0,
                  min((ll)X, a + sum[in] + (t - r[in]) * (in % 2 ? 1 : -1)))
           << endl;
    } else if (a < lim[in].first) {
      cout << max((ll)0,
                  min((ll)X, sum_z[in] + (t - r[in]) * (in % 2 ? 1 : -1)))
           << endl;
    } else {
      cout << max((ll)0,
                  min((ll)X, sum_x[in] + (t - r[in]) * (in % 2 ? 1 : -1)))
           << endl;
    }
  }
}
