#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int r[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int S;
  cin >> S;
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> r[i];
  int q;
  cin >> q;
  int ptr = 1, val = 0;
  int Min = 0, Max = S;
  bool top = 1;
  while (q--) {
    int t;
    cin >> t;
    int a;
    cin >> a;
    for (; ptr <= n && r[ptr] <= t; ++ptr, top ^= 1) {
      int delta = r[ptr] - r[ptr - 1];
      if (Max == Min) {
        val += delta * (top ? -1 : 1);
        val = max(val, 0);
        val = min(val, S);
      } else {
        if (top) {
          int low = Min + val;
          if (low < delta) Min += delta - low;
          val -= delta;
          if (Max + val <= 0) {
            val += Max;
            Min = 0;
            Max = 0;
          }
        } else {
          if (Max + val + delta > S)
            Max = S - val - delta, val = S - Max;
          else
            val += delta;
          if (Max <= Min) {
            val += Max;
            Max = 0;
            Min = 0;
          }
        }
      }
    }
    int ans;
    if (a <= Min) ans = Min + val;
    if (a >= Max) ans = Max + val;
    if (Min < a && a < Max) ans = a + val;
    ans += (t - r[ptr - 1]) * (top ? -1 : 1);
    ans = max(ans, 0);
    ans = min(ans, S);
    cout << ans << "\n";
  }
}
