#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, k;
  cin >> x >> k;
  int r[100005];
  r[0] = 0, r[k + 1] = 1000000000;
  for (int i = 1; i <= k; i++) cin >> r[i];
  int d[100004], s[100004];
  s[0] = 0;
  for (int i = 0; i <= k; i++) {
    if (i % 2)
      d[i] = r[i + 1] - r[i];
    else
      d[i] = r[i] - r[i + 1];
    s[i + 1] = s[i] + d[i];
  }
  int l[100004], u[100004], la[100004], ua[100004];
  l[0] = la[0] = 0, u[0] = ua[0] = x;
  for (int i = 1; i <= k; i++) {
    if (i % 2) {
      if (la[i - 1] + d[i - 1] < 0) {
        l[i] = l[i - 1] + abs(la[i - 1] + d[i - 1]);
        la[i] = 0;
      } else {
        l[i] = l[i - 1];
        la[i] = la[i - 1] + d[i - 1];
      }
      u[i] = u[i - 1];
      ua[i] = max(0, ua[i - 1] + d[i - 1]);
    } else {
      if (ua[i - 1] + d[i - 1] > x) {
        u[i] = u[i - 1] - (ua[i - 1] + d[i - 1] - x);
        ua[i] = x;
      } else {
        u[i] = u[i - 1];
        ua[i] = ua[i - 1] + d[i - 1];
      }
      l[i] = l[i - 1];
      la[i] = min(x, la[i - 1] + d[i - 1]);
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int t, a;
    cin >> t >> a;
    int i = upper_bound(r, r + k + 2, t) - r - 1;
    int ans = a + s[i];
    if (a < l[i]) ans = la[i];
    if (a > u[i]) ans = ua[i];
    if (i % 2)
      ans = min(x, ans + t - r[i]);
    else
      ans = max(0, ans - (t - r[i]));
    cout << ans << endl;
  }
}
