#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200200;
const int MOD7 = 1000000007ll;
const int MOD9 = 1000000009ll;
const int INF = 2000000000;
const double ESP = 1e-9;
const double PI = 3.14159265358979;
const int dir_4r[] = {-1, 1, 0, 0};
const int dir_4c[] = {0, 0, -1, 1};
const int dir_8r[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dir_8c[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int ti[MAXN];
int rem[2];
int main() {
  int x, k, q, qt, index, cnt;
  scanf("%d%d", &x, &k);
  ti[0] = 0;
  for (int i = 1; i <= k; ++i) scanf("%d", &(ti[i]));
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &qt, &(rem[0]));
    rem[1] = x - rem[0];
    index = 0;
    cnt = 0;
    while (ti[index + 1] < qt) {
      int dt = ti[index + 1] - ti[index];
      if (cnt == 0) {
        rem[0] = max(0, rem[0] - dt);
        rem[1] = x - rem[0];
        cnt = 1;
      } else {
        rem[1] = max(0, rem[1] - dt);
        rem[0] = x - rem[1];
        cnt = 0;
      }
      index++;
    }
    int rt = qt - ti[index];
    if (cnt == 0) {
      rem[0] = max(0, rem[0] - rt);
      rem[1] = x - rem[0];
      cnt = 1;
    } else {
      rem[1] = max(0, rem[1] - rt);
      rem[0] = x - rem[1];
      cnt = 0;
    }
    printf("%d\n", rem[0]);
  }
  return 0;
}
