#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll mod = 1e9 + 7;
const int INF = 1e9;
int main() {
  cin.sync_with_stdio(false);
  int X, K;
  cin >> X >> K;
  vector<int> r(K + 2);
  for (int i = (int)(1); i < (int)(K + 1); i++) cin >> r[i];
  r[K + 1] = INF;
  int Q;
  cin >> Q;
  vector<int> s(Q), t(Q), a(Q);
  for (int i = 0; i < (int)(Q); i++) {
    cin >> t[i] >> s[i];
  }
  int cnt = 0;
  for (int i = (int)(1); i < (int)(K + 2); i++) {
    if (i % 2 == 1) {
      for (int j = (int)(cnt); j < (int)(Q); j++) {
        if (t[j] <= r[i]) {
          s[j] = max(s[j] - t[j] + r[i - 1], 0);
          cout << s[j] << endl;
          cnt++;
        } else
          s[j] = max(s[j] - r[i] + r[i - 1], 0);
      }
    } else {
      for (int j = (int)(cnt); j < (int)(Q); j++) {
        if (t[j] <= r[i]) {
          s[j] = min(s[j] + t[j] - r[i - 1], X);
          cout << s[j] << endl;
          cnt++;
        } else
          s[j] = min(s[j] + r[i] - r[i - 1], X);
      }
    }
  }
  return 0;
}
