#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 58;
long long X, K, R[100001], Q;
long long beet[1000001];
int main() {
  cin >> X;
  cin >> K;
  R[K++] = 0;
  for (int i = 1; i < K; i++) {
    cin >> R[i];
  }
  R[K++] = INF;
  for (int i = 1; i < K; i++) {
    if (i % 2 == 1)
      beet[i] = R[i - 1] - R[i];
    else
      beet[i] = R[i] - R[i - 1];
  }
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    long long T, A;
    cin >> T >> A;
    int j = 1;
    while (R[j] <= T) {
      A = min(max(0LL, A + beet[j]), X);
      ++j;
    }
    if (j % 2 == 1)
      A = max(0LL, A - (T - R[j - 1]));
    else
      A = min(X, A + (T - R[j - 1]));
    cout << A << endl;
  }
}
