#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
template <class T>
inline void scan_d(T &ret) {
  char c;
  ret = 0;
  while ((c = getchar()) < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + (c - '0'), c = getchar();
  }
}
int main() {
  int x;
  while (~scanf("%d", &x)) {
    int k;
    int time[100010];
    int q;
    scan_d(k);
    for (int i = 1; i <= k; i++) scanf("%d", &time[i]);
    time[k + 1] = 100000010;
    time[0] = 0;
    scan_d(q);
    int a, t;
    for (int i = 1; i <= q; i++) {
      scan_d(t);
      scan_d(a);
      int flag = 1;
      for (int i = 1; i <= k + 1; i++) {
        if (t > time[i]) {
          if (flag == 1) {
            a = max(0, a - (time[i] - time[i - 1]));
            flag = 0;
          } else if (flag == 0) {
            a = min(x, a + (time[i] - time[i - 1]));
            flag = 1;
          }
        } else if (t <= time[i]) {
          if (flag == 1) {
            a = max(0, a - (t - time[i - 1]));
            flag = 0;
          } else if (flag == 0) {
            a = min(x, a + (t - time[i - 1]));
            flag = 1;
          }
          break;
        }
      }
      printf("%d\n", a);
    }
  }
  return 0;
}
