#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int in() {
  int a;
  scanf("%d ", &a);
  return a;
}
int main() {
  int X = in();
  int K = in();
  vector<int> r(K + 1);
  r[0] = 0;
  for (int i = 0; i < (K); i++) r[i + 1] = in();
  int emp = 0;
  int ful = X;
  vector<int> lo(K + 1), up(K + 1), as(K + 1), bs(K + 1);
  lo[0] = 0;
  up[0] = X;
  as[0] = 0;
  bs[0] = X;
  int a = 0, b = X;
  for (int i = (1); i <= (K); i++) {
    int t = r[i] - r[i - 1];
    if (i % 2 == 1) {
      emp -= t;
      a = max(a, -emp);
      emp = max(emp, 0);
      ful = max(ful - t, 0);
    } else {
      ful += t;
      b = min(b, X - (ful - X));
      ful = min(ful, X);
      emp = min(emp + t, X);
    }
    lo[i] = emp;
    up[i] = ful;
    as[i] = a;
    bs[i] = b;
  }
  int Q = in();
  for (int i = 0; i < (Q); i++) {
    int t = in();
    int a0 = in();
    int k = lower_bound(r.begin(), r.end(), t) - r.begin() - 1;
    int tdiff = t - r[k];
    int plus = k % 2 == 1 ? tdiff : -tdiff;
    if (a0 <= as[k])
      cout << max(min(X, lo[k] + plus), 0) << endl;
    else if (bs[k] <= a0)
      cout << max(min(X, up[k] + plus), 0) << endl;
    else
      cout << max(min(X, lo[k] + plus + a0 - as[k]), 0) << endl;
  }
  return 0;
}
