#include <bits/stdc++.h>
using namespace std;
int X, K, Q;
vector<int> R, T, A;
int comp(int a, int b, int c, int x) {
  if (x >= a)
    return a + c;
  else if (x >= b)
    return x + c;
  else
    return b + c;
}
int main() {
  cin >> X >> K;
  R.resize(K + 2);
  R[0] = 0;
  R[K + 1] = 1E9;
  for (int i = 1; i <= K; ++i) cin >> R[i];
  cin >> Q;
  T.resize(Q);
  A.resize(Q);
  for (int q = 0; q < Q; ++q) cin >> T[q] >> A[q];
  int a = X, b = 0, c = 0, i = 1, j = 0;
  vector<int> ans(Q, 0);
  bool merge = false;
  while (j < Q) {
    if (1 & i) {
      while (j < Q && T[j] <= R[i]) {
        int dt = T[j] - R[i - 1];
        if (!merge) {
          int tmpa = a, tmpb = max(b, dt - c), tmpc = c - dt;
          if (tmpb >= tmpa) {
            tmpb = tmpa = tmpc = 0;
            merge = true;
          }
          ans[j] = comp(tmpa, tmpb, tmpc, A[j]);
        } else {
          ans[j] = max(0, c - dt);
        }
        ++j;
      }
      int dt = R[i] - R[i - 1];
      if (!merge) {
        b = max(b, dt - c);
        c = c - dt;
        if (b >= a) {
          a = b = c = 0;
          merge = true;
        }
      } else {
        a = b = 0;
        c = max(0, c - dt);
      }
    } else {
      while (j < Q && T[j] <= R[i]) {
        int dt = T[j] - R[i - 1];
        if (!merge) {
          int tmpa = min(a, X - c - dt), tmpb = b, tmpc = c + dt;
          if (tmpb >= tmpa) {
            tmpa = tmpb = 0;
            tmpc = X;
            merge = true;
          }
          ans[j] = comp(tmpa, tmpb, tmpc, A[j]);
        } else {
          ans[j] = min(c + dt, X);
        }
        ++j;
      }
      int dt = R[i] - R[i - 1];
      if (!merge) {
        a = min(a, X - c - dt);
        c = c + dt;
        if (b >= a) {
          a = b = 0;
          c = X;
          merge = true;
        }
      } else {
        a = b = 0;
        c = min(X, c + dt);
      }
    }
    ++i;
  }
  for (auto k : ans) cout << k << endl;
  return 0;
}
