#include <bits/stdc++.h>
using namespace std;
long long gcd(long long p, long long q) { return q == 0 ? p : gcd(q, p % q); }
int x, k;
vector<int> ri;
int q;
vector<int> ti;
vector<int> ai;
int main() {
  scanf("%d%d", &x, &k);
  ri.resize(k + 1, 0);
  for (int i = 0; i < k; i++) scanf("%d", &ri[i + 1]);
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int t, a;
    scanf("%d %d", &t, &a);
    int flag = -1;
    for (int i = 1; i < k + 1; i++) {
      if (ri[i] < t) {
        if (flag > 0)
          a = min(a + ri[i] - ri[i - 1], x);
        else
          a = max(a - ri[i] + ri[i - 1], 0);
        flag *= -1;
      } else {
        if (flag > 0)
          a = min(a + t - ri[i - 1], x);
        else
          a = max(a - t + ri[i - 1], 0);
        break;
      }
    }
    if (ri[k] < t) {
      if (flag > 0)
        a = min(a + t - ri[i - 1], x);
      else
        a = max(a - t + ri[i - 1], 0);
    }
    printf("%d\n", a);
  }
  return 0;
}
