#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_x[114514] = {};
  ll sum_p[114514] = {};
  vector<PII> bz, bx;
  cin >> X >> K;
  r[0] = 0;
  for (int i = 0; i < (K); i++) cin >> r[i + 1];
  sum[0] = 0;
  sum_x[0] = X;
  sum_p[0] = 0;
  for (int i = 0; i < (K); i++) {
    sum[i + 1] = sum[i] + (r[i + 1] - r[i]) * updown[i % 2];
    sum_p[i + 1] += sum_p[i] + (r[i + 1] - r[i]) * updown[i % 2];
    sum_x[i + 1] += sum_x[i] + (r[i + 1] - r[i]) * updown[i % 2];
    chmin(sum[i + 1], X);
    chmax(sum[i + 1], 0);
    chmin(sum_x[i + 1], X);
    chmax(sum_x[i + 1], 0);
  }
  int max_X = X, b_zero = -1;
  bx.push_back({-X, 0});
  for (int i = 0; i < (K + 1); i++) {
    int beet = sum_p[i];
    if (i > 1) beet -= sum_p[i - 2];
    if (beet > 0 && beet > X - max_X) {
      max_X = X - beet;
      if (b_zero > max_X) {
        bx.push_back({0, i});
      } else {
        bx.push_back({-max_X, i});
      }
    } else if (beet <= 0) {
      if (b_zero < abs(beet)) {
        b_zero = abs(beet);
        if (abs(beet) >= max_X) {
          bz.push_back({X, i});
        } else {
          bz.push_back({b_zero, i});
        }
      }
    }
  }
  bx.push_back({(int)1e9, (int)1e9});
  bz.push_back({(int)1e9, (int)1e9});
  int Q;
  cin >> Q;
  for (int i = 0; i < (Q); i++) {
    int t, a;
    cin >> t >> a;
    int inb =
        lower_bound(bz.begin(), bz.end(), make_pair(a, -(int)1e9))->second;
    int inx =
        lower_bound(bx.begin(), bx.end(), make_pair(-a, -(int)1e9))->second;
    int in_t = lower_bound(r, r + K + 1, t) - r;
    in_t--;
    if (t == 0) {
      cout << a << endl;
      continue;
    }
    if ((inb == (int)1e9 || bz[inb].first > r[in_t]) &&
        (inx == (int)1e9 || bx[inx].first > r[in_t])) {
      cout << a + sum_p[in_t] + (t - r[in_t]) * updown[in_t % 2] << endl;
    } else if (inb < inx) {
      cout << max(min(sum[in_t] + (t - r[in_t]) * updown[in_t % 2], (ll)X),
                  (ll)0)
           << endl;
    } else {
      cout << max(min(sum_x[in_t] + (t - r[in_t]) * updown[in_t % 2], (ll)X),
                  (ll)0)
           << endl;
    }
  }
}
