#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 20, inf = 0x3f3f3f3f;
int X, K, Q, r[N], t[N], a[N];
int main() {
  cin >> X >> K;
  r[0] = 0;
  for (int i = 1; i <= K; i++) scanf("%d", &r[i]);
  cin >> Q;
  int y, t;
  while (Q--) {
    scanf("%d%d", &t, &y);
    int top = y, down = X - y;
    int ans = top;
    for (int i = 1; i <= K; i++) {
      if (r[i] < t) {
        top = max(0, top - (r[i] - r[i - 1]));
        down = min(X, down + (r[i] - r[i - 1]));
        swap(top, down);
      } else {
        top = max(0, top - (t - r[i - 1]));
        down = min(X, down + (t - r[i - 1]));
        if (i % 2)
          ans = top;
        else
          ans = down;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
