#include <bits/stdc++.h>
using namespace std;
void func(void);
signed signed long long main(void) {
  func();
  ;
  return 0;
}
unsigned signed long long calc(vector<signed signed long long> &r,
                               signed signed long long t,
                               signed signed long long a,
                               signed signed long long b) {
  signed signed long long *ans = &a;
  unsigned signed long long rLen = r.size();
  signed signed long long base_t = 0;
  signed signed long long time;
  signed signed long long diff;
  signed signed long long *up = &a;
  signed signed long long *down = &b;
  for (unsigned signed long long i = 0; i < rLen; i++) {
    if (t >= r[i]) {
      time = r[i] - base_t;
      diff = min(*up, time);
      *up -= diff;
      *down += diff;
      base_t = r[i];
      if (t == r[i]) {
        return *ans;
      }
      do {
        signed signed long long *tmp__ = (down);
        (down) = (up);
        (up) = tmp__;
      } while (0);
    } else {
      time = t - base_t;
      diff = min(*up, time);
      *up -= diff;
      *down += diff;
      return *ans;
    }
  }
  time = t - base_t;
  diff = min(*up, time);
  *up -= diff;
  *down += diff;
  return *ans;
}
void func(void) {
  unsigned signed long long X;
  unsigned signed long long K;
  cin >> X;
  cin >> K;
  vector<signed signed long long> r(K);
  for (unsigned signed long long i = 0; i < K; i++) {
    cin >> r[i];
  }
  unsigned signed long long Q;
  cin >> Q;
  vector<unsigned signed long long> ans(Q, 0);
  for (unsigned signed long long i = 0; i < Q; i++) {
    signed signed long long t, a;
    cin >> t >> a;
    ans[i] = calc(r, t, a, X - a);
  };
  for (unsigned signed long long i = 0; i < Q; i++) {
    cout << ans[i] << endl;
  }
  return;
}
