#include <bits/stdc++.h>
using namespace std;
const int N = 100006;
struct node {
  int x, y;
} a[N];
int b[N];
int n, m, p, l, x, y;
void work(void) {
  int i, j, k, q, t;
  i = 1;
  j = l - 1;
  while (i <= j) {
    k = (i + j) / 2;
    if (x < a[k].y)
      j = k - 1;
    else
      i = k + 1;
  }
  i = a[i - 1].x + 1;
  if (i > 1)
    t = 0;
  else
    t = y;
  while (x >= b[i] && i <= n) {
    q = b[i] - b[i - 1];
    if (i % 2 == 1)
      if (t <= q)
        t = 0;
      else
        t -= q;
    else if (t + q >= p)
      t = p;
    else
      t += q;
    i++;
  }
  q = x - b[i - 1];
  if (i % 2 == 1)
    if (t <= q)
      t = 0;
    else
      t -= q;
  else if (t + q >= p)
    t = p;
  else
    t += q;
  cout << t << endl;
}
int main(void) {
  int i, q, t;
  l = 1;
  cin >> p;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> b[i];
  t = p;
  for (i = 1; i <= n; i++) {
    q = b[i] - b[i - 1];
    if (i % 2 == 1)
      if (t <= q) {
        a[l].x = i;
        a[l].y = b[i];
        l++;
        t = 0;
      } else
        t -= q;
    else if (t + q >= p)
      t = p;
    else
      t += q;
  }
  cin >> m;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    work();
  }
  return 0;
}
