#include <bits/stdc++.h>
using ll = long long int;
const int INF = (1 << 30);
const ll INFLL = (1ll << 60);
const ll MOD = (ll)(1e9 + 7);
void mul_mod(ll& a, ll b) {
  a *= b;
  a %= MOD;
}
void add_mod(ll& a, ll b) {
  a = (a < MOD) ? a : (a - MOD);
  b = (b < MOD) ? b : (b - MOD);
  a += b;
  a = (a < MOD) ? a : (a - MOD);
}
ll v[100100];
int main(void) {
  int n, q, i, j = 1;
  ll ans, l, r, s = 0ll, a, x, t;
  std::cin >> x;
  l = 0ll;
  r = x;
  std::cin >> n;
  ++n;
  for (i = 1; i < n; ++i) {
    std::cin >> v[i];
  }
  v[n] = INFLL;
  std::cin >> q;
  for (i = 0; i < q; ++i) {
    std::cin >> t >> a;
    if (!(t < v[j])) {
      if (j % 2) {
        s += v[j - 1] - v[j];
        l = std::max(l, -s);
        r = std::max(l, r);
      } else {
        s += v[j] - v[j - 1];
        r = std::min(r, x - s);
        l = std::min(l, r);
      }
      ++j;
    }
    a = std::min(std::max(a, l), r);
    if (j % 2) {
      ans = std::max(a + s - (t - v[j - 1]), 0ll);
    } else {
      ans = std::min(a + s + (t - v[j - 1]), x);
    }
    std::cout << ans << std::endl;
  }
  return 0;
}
