#include <bits/stdc++.h>
using namespace std;
int x, n, q, t, val, sol, u, i;
int v[100005], a[100005], amax[100005], sum[100005];
int main() {
  cin >> x >> n;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
  }
  a[0] = amax[0] = 0;
  for (i = 1; i <= n; i++) {
    sum[i] = sum[i - 1];
    if (i % 2 == 1) {
      a[i] = max(0, a[i - 1] - (v[i] - v[i - 1]));
      if (a[i] == 0) {
        sum[i] += v[i] - v[i - 1] - a[i - 1];
      }
    } else {
      a[i] = min(x, a[i - 1] + v[i] - v[i - 1]);
    }
    amax[i] = max(amax[i - 1], a[i]);
  }
  v[n + 1] = 1000000001;
  u = 0;
  cin >> q;
  for (; q; q--) {
    cin >> t >> val;
    while (v[u + 1] <= t) {
      u++;
    }
    sol = max(0, val - sum[u]);
    sol = min(sol, x - amax[u]);
    sol += a[u];
    if (u % 2 == 1) {
      sol = min(x, sol + t - v[u]);
    } else {
      sol = max(0, sol - (t - v[u]));
    }
    cout << sol << "\n";
  }
  return 0;
}
