#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const double PI = acos(-1);
const long long MOD = 1e9 + 7;
using namespace std;
int X, n;
int sig(int u) { return (u % 2 != 0) ? -1 : 1; }
long long t[600000], d[600000], need[600000];
deque<pair<int, int> > colaP, colaN;
void mover(int time, int &iz) {
  while (iz <= n) {
    if (t[iz] < time) {
      if (need[iz] < 0) {
        if (colaN.empty() || abs(colaN.back().first) < abs(need[iz]))
          colaN.push_back({need[iz], iz});
      } else {
        if (colaP.empty() || abs(colaP.back().first) < abs(need[iz]))
          colaP.push_back({need[iz], iz});
      }
      iz++;
    } else
      break;
  }
}
void calc(int time, int &pos, int &vup) {
  while (pos <= n) {
    if (time > t[pos]) {
      vup += d[pos];
      vup = max(0, vup);
      vup = min(X, vup);
      pos++;
    } else
      break;
  }
}
void apply(int &valor, int time, int i) {
  int delta = abs(((i > 0) ? t[i - 1] : 0) - time) * sig(i);
  valor += delta;
  valor = max(valor, 0);
  valor = min(valor, X);
}
int main() {
  cin >> X >> n;
  int vup = X, vdown = 0;
  t[0] = 0;
  t[n + 1] = 2e9;
  long long ant = 0;
  for (long long i = 1; i < n + 1; i++) {
    cin >> t[i];
    d[i] = abs(t[i] - t[i - 1]) * sig(i);
    need[i] = ant + d[i];
    ant = need[i];
  }
  int queries;
  cin >> queries;
  int time, valor, iztime = 0, izup, izdown, lst;
  izup = izdown = 0;
  for (long long i = 0; i < queries; i++) {
    cin >> time >> valor;
    mover(time, iztime);
    if (!colaP.empty() && colaP.back().first + valor >= X)
      calc(time, izup, vup), lst = izup, valor = vup;
    else if (!colaN.empty() && colaN.back().first + valor < 0)
      calc(time, izdown, vdown), lst = izdown, valor = vdown;
    else {
      lst = lower_bound(t, t + n, time) - t;
      if (lst != 0) valor += need[lst - 1];
    }
    apply(valor, time, lst);
    cout << valor << endl;
  }
}
