#include <bits/stdc++.h>
using namespace std;
int readint() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
inline string tos(int x) {
  string s;
  while (x) s = (char)(x % 10 + '0') + s, x /= 10;
  return s;
}
inline int pt(int a[], int l, int r) {
  int p, i, j;
  p = a[l];
  i = l;
  j = r + 1;
  for (;;) {
    while (a[++i] < p)
      if (i >= r) break;
    while (a[--j] > p)
      if (j <= l) break;
    if (i >= j)
      break;
    else
      swap(a[i], a[j]);
  }
  if (j == l) return j;
  swap(a[l], a[j]);
  return j;
}
inline void q_sort(int a[], int l, int r) {
  int q;
  if (r > l) {
    q = pt(a, l, r);
    q_sort(a, l, q - 1);
    q_sort(a, q + 1, r);
  }
}
int n, x;
int tr[100005], r[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, j, q, t, v, a, b;
  cin >> x;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> tr[i];
  for (i = 2; i <= n; i++) r[i] = tr[i] - tr[i - 1];
  r[1] = tr[1];
  cin >> q;
  int beg;
  int bz = 0;
  while (q--) {
    cin >> t >> v;
    a = v;
    bz = 0;
    b = x - v;
    for (beg = 0; beg < n; beg++) {
      if (t < tr[beg + 1]) break;
      if (!bz)
        a = max(0, a - r[beg + 1]);
      else
        a = min(x, a + r[beg + 1]);
      b = x - a;
      bz = 1 - bz;
    }
    if (!bz)
      a = max(0, a - (t - tr[beg]));
    else
      a = min(x, a + (t - tr[beg]));
    cout << a << endl;
  }
  return 0;
}
