#include <bits/stdc++.h>
using namespace std;
int X, K, Q;
int r[100001];
int t, a;
int main() {
  cin >> X >> K;
  for (int(i) = (1); (i) < (K + 1); (i)++) cin >> r[i];
  r[K + 1] = 999999999;
  cin >> Q;
  int times = 1;
  int over = X, under = 0;
  int center = 0;
  int ans;
  for (int((i)) = (0); ((i)) < ((Q)); ((i))++) {
    cin >> t >> a;
    while (r[times] < t) {
      if (times % 2) {
        center -= (r[times] - r[times - 1]);
        if (under + center < 0) under = -center;
      } else {
        center += (r[times] - r[times - 1]);
        if (over + center > X) over = X - center;
      }
      times++;
    }
    ans = t - r[times - 1];
    if (times % 2) ans = -ans;
    ans += center;
    if (a < under)
      cout << max(0, under + ans) << endl;
    else if (a < over)
      cout << a + ans << endl;
    else
      cout << min(X, over + ans) << endl;
  }
  cin >> Q;
  return 0;
}
