#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto &i : v) is >> i;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  const string delimiter = "\n";
  for (int i = (int)(0); i < (int)(v.size()); i++) {
    os << v[i];
    if (i != v.size() - 1) os << delimiter;
  }
  return os;
}
int main() {
  cin.sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int x, k;
  cin >> x >> k;
  vector<int> r(k + 1);
  for (int i = (int)(0); i < (int)(k); i++) cin >> r[i + 1];
  vector<int> lit(k + 1), much(k + 1), els(k + 1);
  vector<int> conlit(k + 1), conmuch(k + 1);
  lit[0] = 0;
  much[0] = x;
  conlit[0] = 0;
  conmuch[0] = x;
  for (int i = (int)(0); i < (int)(k); i++) {
    int dif = r[i + 1] - r[i];
    if (i % 2 == 0) {
      els[i + 1] = els[i] - dif;
      if (lit[i] - dif < 0) {
        lit[i + 1] = 0;
        chmax(conlit[i + 1], -els[i + 1]);
      } else {
        lit[i + 1] = lit[i] - dif;
        conlit[i + 1] = conlit[i];
      }
      much[i + 1] = max(0, much[i] - dif);
      conmuch[i + 1] = conmuch[i];
    } else {
      els[i + 1] = els[i] + dif;
      if (much[i] + dif > x) {
        much[i + 1] = x;
        chmin(conmuch[i + 1], x - els[i + 1]);
      } else {
        much[i + 1] = much[i] + dif;
        conmuch[i + 1] = conmuch[i];
      }
      lit[i + 1] = min(x, lit[i] + dif);
      conlit[i + 1] = conlit[i];
    }
  }
  int q;
  cin >> q;
  for (int i = (int)(0); i < (int)(q); i++) {
    int t, a;
    cin >> t >> a;
    if (t >= r[k]) {
      int ans;
      if (k % 2 == 0) {
        if (conlit[k] > a)
          ans = lit[k] - (t - r[k]);
        else if (conmuch[k] < a)
          ans = much[k] - (t - r[k]);
        else
          ans = a + els[k] - (t - r[k]);
        cout << max(0, ans) << endl;
      } else {
        if (conlit[k] > a)
          ans = lit[k] + (t - r[k]);
        else if (conmuch[k] < a)
          ans = much[k] + (t - r[k]);
        else
          ans = a + els[k] + (t - r[k]);
        cout << min(x, ans) << endl;
      }
      continue;
    }
    int lb = 0, ub = k;
    while (ub - lb > 1) {
      int mid = (ub + lb) / 2;
      if (r[mid] > t)
        ub = mid;
      else
        lb = mid;
    }
    int ans;
    if (lb % 2 == 0) {
      if (conlit[lb] > a)
        ans = lit[lb] - (t - r[lb]);
      else if (conmuch[lb] < a)
        ans = much[lb] - (t - r[lb]);
      else
        ans = a + els[lb] - (t - r[lb]);
      cout << max(0, ans) << endl;
    } else {
      if (conlit[lb] > a)
        ans = lit[lb] + (t - r[lb]);
      else if (conmuch[lb] < a)
        ans = much[lb] + (t - r[lb]);
      else
        ans = a + els[lb] + (t - r[lb]);
      cout << min(x, ans) << endl;
    }
  }
  return 0;
}
