#include <bits/stdc++.h>
using namespace std;
template <typename T>
void in(T &x) {
  x = 0;
  bool neg = false;
  register T c = getchar();
  if (c == '-') neg = true, c = getchar();
  while ((c < 48) || (c > 57)) c = getchar();
  for (; c < 48 || c > 57; c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) x = (x << 3) + (x << 1) + (c & 15);
  if (neg) x *= -1;
}
long long arr[100005];
int main() {
  long long s;
  in(s);
  ;
  long long nn;
  in(nn);
  ;
  for (int i = 0; i < nn; ++i) {
    in(arr[i]);
  }
  long long n;
  in(n);
  ;
  for (int i = 0; i < n; ++i) {
    long long t;
    in(t);
    ;
    long long a;
    in(a);
    ;
    long long b = s - a;
    long long sum = 0;
    long long amt;
    long long temp1;
    long long maxx;
    bool aup = true, over = false;
    for (int i1 = 0; i1 == 0 || t > arr[i1 - 1]; ++i1) {
      temp1 = arr[i1];
      if (temp1 == 0) over = true;
      maxx = min(t, over ? t : temp1);
      if (i1 == 0) {
        amt = min(maxx, a);
        a -= amt;
        b += amt;
        aup = !aup;
      } else {
        if (aup) {
          amt = min(maxx - arr[i1 - 1], a);
          a -= amt;
          b += amt;
          aup = !aup;
        } else {
          amt = min(maxx - arr[i1 - 1], b);
          b -= amt;
          a += amt;
          aup = !aup;
        }
      }
      if (over) break;
    }
    printf("%d\n", a);
  }
}
