#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, k;
  cin >> x >> k;
  vector<long long> r(k);
  for (int i = 0; i < k; ++i) scanf("%lld", &r[i]);
  int q;
  cin >> q;
  int i = 0;
  int d = 0;
  long long le = 0, ri = x;
  long long c = 0;
  while (q--) {
    long long t, a;
    scanf("%lld %lld", &t, &a);
    while (i < k && r[i] < t) {
      if (i % 2 == 0)
        c -= r[i] - d;
      else
        c += r[i] - d;
      le = max(le, -c);
      ri = min(ri, x - c);
      d = r[i++];
    }
    long long p;
    if (a <= le)
      p = le + c;
    else if (a >= ri)
      p = ri + c;
    else
      p = a + c;
    long long ans;
    if (i % 2 == 1)
      ans = p + t - d;
    else
      ans = p - (t - d);
    ans = max(ans, 0LL);
    ans = min(ans, x);
    printf("%lld\n", ans);
  }
  return 0;
}
