#include <bits/stdc++.h>
using namespace std;
const long long max4 = 10004;
const long long maxx = 100005;
const long long max6 = 1000006;
const long long max7 = 10000007;
const long long lg4 = 13;
const long long lg5 = 17;
const long long lg6 = 20;
const long long INF = 2LL * 1000000000;
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b > 0) {
    long long t = a % b;
    a = b, b = t;
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long is_prime(long long n) {
  if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0)) return 0;
  for (long long i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
    if (n % i == 0) return 0;
  return 1;
}
long long r[maxx], p[maxx];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  ;
  long long X, k;
  cin >> X >> k;
  for (long long i = 1; i <= k; i++) {
    cin >> r[i];
  }
  for (long long i = 1; i <= k; i++) {
    if (i % 2 == 0)
      p[i] = p[i - 1] + (r[i] - r[i - 1]);
    else
      p[i] = p[i - 1] - (r[i] - r[i - 1]);
  }
  long long q, x, y, pos, d, res;
  cin >> q;
  while (q--) {
    cin >> x >> y;
    pos = upper_bound(r + 1, r + k + 1, x) - r - 1;
    d = x - r[pos];
    if (pos % 2 == 0) d = -d;
    res = y;
    for (long long i = 1; i <= pos; i++) {
      if (i % 2 == 1) res -= min(res, r[i] - r[i - 1]);
      if (i % 2 == 0) res += min(X - res, r[i] - r[i - 1]);
    }
    cout << max(0LL, res + min(X - res, d)) << '\n';
  }
  return 0;
}
