#include <bits/stdc++.h>
using namespace std;
struct D_st {
  long long t;
  long long d;
  long long up;
  long long down;
};
long long X, K, Q;
long long R[100010];
vector<D_st> D;
D_st search(long long t) {
  long long high = D.size() - 1;
  long long low = 0;
  long long cur = high / 2;
  long long prev = cur;
  long long ret = cur;
  for (long long i = 0; i < 100; ++i) {
    if (D[cur].t == t) {
      return D[cur];
    } else if (D[cur].t > t) {
      high = cur;
    } else {
      low = cur;
    }
    cur = (high - low) / 2 + low;
  }
  return D[cur];
}
int main() {
  memset(R, 0, sizeof(R));
  cin >> X >> K;
  long long cur = 0;
  long long max_up = 0;
  long long min_down = 0;
  for (long long i = 0; i < K; ++i) {
    scanf("%lld", &R[i]);
    long long prev = 0;
    if (i != 0) {
      prev = R[i - 1];
    }
    if (i % 2 == 0) {
      cur -= (R[i] - prev);
    } else {
      cur += (R[i] - prev);
    }
    if (cur < -X) {
      cur = -X;
    } else if (cur > X) {
      cur = X;
    }
    max_up = max((R[i] - prev), max_up);
    min_down = min((R[i] - prev), min_down);
    D_st d;
    d.t = R[i];
    d.d = cur;
    d.up = max_up;
    d.down = min_down;
    D.push_back(d);
  }
  cin >> Q;
  for (long long i = 0; i < Q; ++i) {
    long long t, a;
    cin >> t >> a;
    D_st tmp = search(t);
    long long ret;
    if (a > tmp.up) {
      ret = a + tmp.d - (X - tmp.up);
    } else if (a < tmp.down) {
      ret = a + tmp.d + tmp.down;
    } else {
      ret = a + tmp.d;
    }
    printf("%lld\n", ret);
  }
  return 0;
}
