#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
template <typename T, typename U>
istream &operator>>(istream &i, pair<T, U> &A) {
  i >> A.first >> A.second;
  return i;
}
template <typename T>
istream &operator>>(istream &i, vector<T> &A) {
  for (auto &I : A) {
    i >> I;
  }
  return i;
}
template <typename T, typename U>
ostream &operator<<(ostream &o, const pair<T, U> &A) {
  o << A.first << " " << A.second;
  return o;
}
template <typename T>
ostream &operator<<(ostream &o, const vector<T> &A) {
  int i = A.size();
  for (auto &I : A) {
    o << I << (--i ? " " : "");
  }
  return o;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int X, K;
  cin >> X >> K;
  vector<long long int> T(K + 1, 0);
  for (int i = 1; i <= K; i++) {
    cin >> T[i];
  }
  vector<long long int> A1(K + 1, X);
  vector<long long int> A2(K + 1, 0);
  vector<long long int> up(K + 1, X);
  vector<long long int> lw(K + 1, 0);
  for (int i = 1; i <= K; i++) {
    long long int dif = T[i] - T[i - 1];
    long long int sand = A1[i - 1];
    if (i & 1) {
      sand -= dif;
      up[i] = up[i - 1];
      sand = max(sand, 0LL);
      A1[i] = sand;
    } else {
      sand += dif;
      up[i] = up[i - 1] - max(sand - X, 0LL);
      sand = min(sand, X);
      A1[i] = sand;
    }
    sand = A2[i - 1];
    if (i & 1) {
      sand -= dif;
      lw[i] = lw[i - 1] + max(-sand, 0LL);
      sand = max(sand, 0LL);
      A2[i] = sand;
    } else {
      sand += dif;
      lw[i] = lw[i - 1];
      sand = min(sand, X);
      A2[i] = sand;
    }
  }
  long long int Q;
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    long long int t, a;
    cin >> t >> a;
    long long int idx = upper_bound(T.begin(), T.end(), t) - T.begin();
    idx--;
    long long int sand;
    if (lw[idx] < a && a < up[idx]) {
      sand = A1[idx] - (up[idx] - a);
    } else if (a < lw[idx]) {
      sand = A2[idx];
    } else {
      sand = A1[idx];
    }
    long long int dif = t - T[idx];
    if (idx & 1) {
      sand += dif;
      sand = min(sand, X);
    } else {
      sand -= dif;
      sand = max(sand, 0LL);
    }
    cout << sand << endl;
  }
  return 0;
}
