#include <bits/stdc++.h>
using namespace std;
int X, K, Q, t, a, p[100009], sp[100009], va[100009], vb[100009];
long long s[100009], spa[19][100009], spb[19][100009];
vector<int> g[100009];
long long rangemin(int l, int r) {
  if (l >= r) return 1LL << 60;
  return min(spa[sp[r - l]][l], spa[sp[r - l]][r - (1 << sp[r - l])]);
}
long long rangemax(int l, int r) {
  if (l >= r) return -1LL << 60;
  return max(spb[sp[r - l]][l], spb[sp[r - l]][r - (1 << sp[r - l])]);
}
int main() {
  cin >> X >> K;
  for (int i = 1; i <= K; i++)
    cin >> p[i], s[i] = s[i - 1] + (p[i] - p[i - 1]) * (i & 1 ? -1 : 1);
  va[0] = 0;
  vb[0] = X;
  for (int i = 1; i <= K; i++) {
    va[i] = min(max(va[i - 1] + (p[i] - p[i - 1]) * (i & 1 ? -1 : 1), 0), X);
    vb[i] = min(max(vb[i - 1] + (p[i] - p[i - 1]) * (i & 1 ? -1 : 1), 0), X);
  }
  for (int i = 1; i <= K + 1; i++) {
    while ((2 << sp[i]) < i) sp[i]++;
  }
  for (int i = 0; i <= K; i++) spa[0][i] = s[i], spb[0][i] = s[i];
  for (int i = 0; i < 16; i++) {
    for (int j = 0; j + (2 << i) <= K; j++) {
      spa[i + 1][j] = min(spa[i][j], spa[i][j + (1 << i)]);
      spb[i + 1][j] = max(spb[i][j], spb[i][j + (1 << i)]);
    }
  }
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> t >> a;
    int ptr = lower_bound(p, p + K + 1, t + 1) - p - 1;
    int la = 0, ra = ptr + 1;
    while (ra - la > 1) {
      int m = (la + ra) >> 1;
      if (rangemin(0, m + 1) > -a)
        la = m;
      else
        ra = m;
    }
    int lb = 0, rb = ptr + 1;
    while (rb - lb > 1) {
      int m = (lb + rb) >> 1;
      if (rangemax(0, m + 1) < X - a)
        lb = m;
      else
        rb = m;
    }
    int curval = s[ptr] + a;
    if (la < lb) curval = va[ptr];
    if (la > lb) curval = vb[ptr];
    curval = min(max(curval + (t - p[ptr]) * (ptr & 1 ? 1 : -1), 0), X * 1);
    cout << curval << '\n';
  }
  return 0;
}
