#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int x;
int k;
int r[N + 5];
int q;
vector<pair<int, int> > lq;
int main() {
  scanf("%d", &x);
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &r[i]);
  }
  r[k + 1] = (int)1e9;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    lq.push_back(make_pair(a, b));
  }
  int id = 0;
  int baw = 0;
  int at = x;
  int ps = 0;
  int maksi = x;
  int mini = 0;
  for (int i = 1; i <= k + 1; i++) {
    int dif = r[i] - r[i - 1];
    while (id < lq.size() && lq[id].first <= r[i]) {
      int y = lq[id].second;
      y = max(y, baw);
      y = min(y, at);
      int ans = y - ps;
      if (i & 1) {
        ans -= lq[id].first - r[i - 1];
      } else {
        ans += lq[id].first - r[i - 1];
      }
      ans = max(0, ans);
      ans = min(ans, x);
      printf("%d\n", ans);
      id++;
    }
    if (i & 1) {
      ps += dif;
      maksi -= dif;
      mini -= dif;
      if (mini < 0) baw -= mini, mini = 0;
    } else {
      ps -= dif;
      maksi += dif;
      mini += dif;
      if (maksi > x) at -= maksi - x, maksi = x;
    }
  }
  return 0;
}
