#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
const double EPS = 1e-11;
int x, k;
int r[125252];
int main() {
  scanf("%d%d", &x, &k);
  r[0] = 0;
  for (int i = 0; i < (int)(k); ++i) scanf("%d", r + i + 1);
  k++;
  int add = 0;
  int low = 0;
  int high = x;
  int iter = 0;
  int q;
  scanf("%d", &q);
  while (q--) {
    int t, a;
    scanf("%d%d", &t, &a);
    while (iter + 2 < k && t >= r[iter + 2]) {
      int g = r[iter + 1] - r[iter];
      int h = r[iter + 2] - r[iter + 1];
      if (low == high) {
        low = x - max(0, low - g);
        low = x - max(0, low - h);
        high = low;
      } else {
        g = min((g), (x));
        h = min((h), (x));
        low = max((low), (g - add));
        low = min((low), (x));
        if (high < low) {
          low = high = h;
          add = 0;
        } else {
          add -= g;
          high = min((high), (x - h - add));
          high = max((high), (0));
          if (high < low) {
            low = high = x;
            add = 0;
          } else {
            add += h;
          }
        }
      }
      iter += 2;
    }
    a = max((a), (low));
    a = min((a), (high));
    a += add;
    if (iter + 1 < k && t >= r[iter + 1]) {
      a = max(0, a - (r[iter + 1] - r[iter]));
      a = x - a;
      a = max(0, a - (t - r[iter + 1]));
      a = x - a;
    } else {
      a = max(0, a - (t - r[iter]));
    }
    printf("%d\n", a);
  }
  return 0;
}
