#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0)
    return c;
  else
    return c + (long long)(1E9 + 7);
}
long long inf = (long long)1E17;
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
void Max(long long &pos, long long val) { pos = max(pos, val); }
void Min(long long &pos, long long val) { pos = min(pos, val); }
void Add(long long &pos, long long val) { pos = mod(pos + val); }
long double EPS = 1E-9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long x;
  cin >> x;
  long long k;
  cin >> k;
  long long t[k + 1];
  t[0] = 0;
  for (long long i = 1; i <= k; i++) cin >> t[i];
  long long l[k + 1], r[k + 1];
  long long s[k + 1];
  s[0] = 0;
  for (long long i = 1; i <= k; i++) {
    if (i % 2 == 1) {
      s[i] = s[i - 1] - (t[i] - t[i - 1]);
    } else {
      s[i] = s[i - 1] + (t[i] - t[i - 1]);
    }
  }
  l[0] = 0;
  r[0] = x;
  for (long long i = 1; i <= k; i++) {
    l[i] = l[i - 1];
    r[i] = r[i - 1];
    if (i % 2 == 1) {
      if (r[i - 1] + s[i] < 0) {
        r[i] = -inf;
        l[i] = inf;
      } else if (l[i - 1] + s[i] < 0) {
        l[i] = l[i - 1] + (-(l[i - 1] + s[i]));
      }
    } else {
      if (l[i - 1] + s[i] > x) {
        r[i] = -inf;
        l[i] = inf;
      } else if (r[i - 1] + s[i] > x) {
        r[i] = r[i - 1] - (r[i - 1] + s[i] - x);
      }
    }
  }
  long long q;
  cin >> q;
  while (q--) {
    long long c, a;
    cin >> c >> a;
    if (c == 0) {
      cout << a << endl;
      continue;
    }
    long long pos = lower_bound(t, t + k + 1, c) - t - 1;
    long long res;
    if (l[pos] <= a && a <= r[pos]) {
      res = a + s[pos];
      if (pos % 2 == 0) {
        res -= c - t[pos];
      } else {
        res += c - t[pos];
      }
    } else if (a < l[pos]) {
      res = s[pos] + l[pos];
      if (pos % 2 == 0) {
        res -= c - t[pos];
      } else {
        res += c - t[pos];
      }
    } else {
      res = s[pos] + r[pos];
      if (pos % 2 == 0) {
        res -= c - t[pos];
      } else {
        res += c - t[pos];
      }
    }
    if (res < 0) res = 0;
    if (res > x) res = x;
    cout << res << endl;
  }
  return 0;
}
