#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-7;
const long long mod = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int x, k, q;
vector<int> a;
int main() {
  cin >> x >> k;
  a = vector<int>(k + 1);
  for (int i = 1; i <= k; i++) cin >> a[i];
  cin >> q;
  int l = 0, L = 0, r = x, R = x, I = 0;
  for (int i = 0; i < q; i++) {
    int t, A;
    cin >> t >> A;
    while (I < k && t >= a[I + 1]) {
      if (I <= k && t >= a[I]) {
        int s = a[I + 1] - a[I];
        if (I % 2 == 0) {
          L -= s;
          R -= s;
          if (L < 0) {
            l -= L;
            L = 0;
          }
        } else {
          L += s;
          R += s;
          if (R > x) {
            r -= R - x;
            R = x;
          }
        }
        I++;
      }
    }
    t -= a[I];
    int res;
    if (l < A && A < r) res = L + A - l;
    if (A <= l) res = L;
    if (r <= A) res = R;
    if (I % 2 == 0)
      res -= t;
    else
      res += t;
    if (res < 0) res = 0;
    if (res > x) res = x;
    cout << res << endl;
  }
}
