#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int X, K, Q;
int r[100010];
int d[100010];
int t, a;
int ans;
int main() {
  cin >> X >> K;
  for (int i = (1); i < (int)K + 1; i++) {
    cin >> r[i];
    d[i - 1] = r[i] - r[i - 1];
  }
  cin >> Q;
  for (int i = (0); i < (int)Q; i++) {
    cin >> t >> a;
    for (int j = (0); j < (int)K; j++) {
      if (r[j + 1] > t) {
        if (j % 2 == 0)
          a = max(0, a - (t - r[j]));
        else
          a = min(X, a + (t - r[j]));
        break;
      }
      if (j % 2 == 0)
        a = max(0, a - d[j]);
      else
        a = min(X, a + d[j]);
    }
    if (t > r[K]) {
      if (K % 2 == 0)
        a = max(0, a - (t - r[K]));
      else
        a = min(X, a + (t - r[K]));
    }
    cout << (a) << endl;
  }
  return 0;
}
