#include <bits/stdc++.h>
using namespace std;
const int K = 1e5 + 9;
long long r[K];
inline long long read() {
  long long s = 1, a = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') s = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    a = a * 10 + ch - '0';
    ch = getchar();
  }
  return s * a;
}
inline void turn(long long &v, long long x) {
  if (v < 0) v = 0;
  if (v > x) v = x;
}
int main() {
  long long x = read(), k = read();
  for (int i = 1; i <= k; i++) r[i] = read();
  long long q = read();
  long long low = 0, mid = 0, upp = x;
  int i = 1, sign = -1;
  while (q--) {
    long long t = read(), a = read();
    while (i <= k && r[i] <= t) {
      long long dta = (r[i] - r[i - 1]) * sign;
      low += dta, upp += dta, mid += dta;
      turn(low, x), turn(mid, x), turn(upp, x);
      i++, sign *= -1;
    }
    long long res = a + mid;
    long long dta = (t - r[i - 1]) * sign;
    if (res < low) res = low;
    if (res > upp) res = upp;
    res += dta, turn(res, x);
    printf("%lld\n", res);
  }
  return 0;
}
