#include <bits/stdc++.h>
using namespace std;
int x, k, r[100005], q, t, a, b;
inline int input() {
  char t = getchar();
  int x = 0;
  while (t < 48 || t > 57) t = getchar();
  for (; t >= 48 && t <= 57; t = getchar()) x = x * 10 + t - 48;
  return x;
}
inline void output(int y) {
  if (y > 9) output(y / 10);
  putchar(y % 10 + 48);
}
int main() {
  x = input(), k = input();
  for (int i = 1; i <= k; i++) r[i] = input();
  q = input();
  for (int i = 1; i <= q; i++) {
    t = input(), a = input(), b = x - a;
    int j = 1, temp = 0;
    while (r[j] <= t && j <= k) {
      temp = r[j] - r[j - 1];
      if (j & 1)
        if (a <= temp)
          a = 0, b = x;
        else
          a -= temp, b += temp;
      else if (b <= temp)
        b = 0, a = x;
      else
        a += temp, b -= temp;
      j++;
    }
    temp = t - r[j - 1];
    if (j & 1)
      if (a < temp)
        a = 0, b = x;
      else
        a -= temp, b += temp;
    else if (b < temp)
      b = 0, a = x;
    else
      a += temp, b -= temp;
    output(a), putchar('\n');
  }
  return 0;
}
