#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long x, k;
  cin >> x >> k;
  vector<long long> r(k + 2);
  r[0] = 0;
  for (long long i = 0; i < long long(k); ++i) cin >> r[i + 1];
  r[k + 1] = 1000000010;
  vector<long long> a(k + 2), b(k + 2), c(k + 2);
  a[0] = x;
  for (long long i = 1; i < long long(k + 2); ++i) {
    a[i] = a[i - 1] + (i % 2 == 0 ? 1 : -1) * (r[i] - r[i - 1]);
    a[i] = max(0ll, min(x, a[i]));
  }
  b[0] = 0;
  for (long long i = 1; i < long long(k + 2); ++i) {
    b[i] = b[i - 1] + (i % 2 == 0 ? 1 : -1) * (r[i] - r[i - 1]);
    b[i] = max(0ll, min(x, b[i]));
  }
  c[0] = 0;
  for (long long i = 1; i < long long(k + 2); ++i) {
    c[i] = c[i - 1] + (i % 2 == 0 ? 1 : -1) * (r[i] - r[i - 1]);
  }
  map<long long, long long> min_dict, max_dict;
  long long mi = 0, ma = 0;
  for (long long i = 0; i < long long(k + 2); ++i) {
    if (c[i] < mi) {
      mi = c[i];
      min_dict[-mi] = i;
    }
    if (c[i] > ma) {
      ma = c[i];
      max_dict[ma] = i;
    }
  }
  long long q;
  cin >> q;
  for (long long j = 0; j < long long(q); ++j) {
    long long t, p;
    cin >> t >> p;
    long long i = upper_bound(r.begin(), r.end(), t) - r.begin() - 1;
    auto itr = min_dict.lower_bound(p);
    if (itr != min_dict.end()) {
      long long min_i = itr->second;
      if (i >= min_i) {
        long long u = b[i] + (i % 2 == 1 ? 1 : -1) * (t - r[i]);
        u = max(0ll, min(x, u));
        cout << u << endl;
        continue;
      }
    }
    itr = max_dict.lower_bound(x - p);
    if (itr != min_dict.end()) {
      long long max_i = itr->second;
      if (i >= max_i) {
        long long u = a[i] + (i % 2 == 1 ? 1 : -1) * (t - r[i]);
        u = max(0ll, min(x, u));
        cout << u << endl;
        continue;
      }
    }
    long long u = p + c[i] + (i % 2 == 1 ? 1 : -1) * (t - r[i]);
    u = max(0ll, min(x, u));
    cout << u << endl;
  }
}
