#include <bits/stdc++.h>
using namespace std;
int n, i, j, k, x, y, z, m, q, w, h;
int a[100500], b[100500];
int min1[1005], max1[1005], val[1005];
int minbl[1005][505], maxbl[1005][505], curbl0[1005][505], curblx[1005][505];
int main() {
  freopen("input.txt", "r", stdin);
  cin >> x >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2)
      b[i - 1] = a[i - 1] - a[i];
    else
      b[i - 1] = a[i] - a[i - 1];
  }
  for (i = 0; i < n; i++) {
    a[i] = a[i + 1];
  }
  for (i = 0; i < 323; i++) {
    int cur = 0;
    int mn = 1000000007, mx = -1000000007;
    for (j = i * 310; j < i * 310 + 310; j++) {
      cur += b[j];
      mn = min(mn, cur);
      mx = max(mx, cur);
      minbl[i][j - i * 310] = mn;
      maxbl[i][j - i * 310] = mx;
    }
    val[i] = cur;
    for (j = 0; j < 310; j++) {
      int cr = 0;
      for (k = j + 1; k < 310; k++) {
        cr += b[k + i * 310];
        cr = max(cr, 0);
        cr = min(cr, x);
      }
      curbl0[i][j] = cr;
      cr = x;
      for (k = j + 1; k < 310; k++) {
        cr += b[k + i * 310];
        cr = max(cr, 0);
        cr = min(cr, x);
      }
      curblx[i][j] = cr;
    }
  }
  cin >> q;
  for (i = 0; i < q; i++) {
    int tim;
    scanf("%d %d", &tim, &z);
    for (j = 0; j < 323; j++) {
      if (j * 310 + 310 >= n || a[j * 310 + 310 - 1] >= tim) break;
      int mn = minbl[j][310 - 1];
      int mx = maxbl[j][310 - 1];
      if (z + mn >= 0 && z + mx <= x) {
        z += val[j];
        continue;
      }
      int l = 0, r = 310 - 1;
      while (l < r) {
        int mid = (l + r) / 2;
        int mn = minbl[j][mid];
        int mx = maxbl[j][mid];
        if (z + mn < 0 || z + mn > x)
          r = mid;
        else
          l = mid + 1;
      }
      mn = minbl[j][l];
      mx = maxbl[j][l];
      if (z + mn < 0)
        z = 0;
      else if (z + mx > x)
        z = x;
      if (z == 0) {
        z = curbl0[j][l];
      } else
        z = curblx[j][l];
    }
    int pos = j * 310;
    while (tim > a[pos] && pos < n) {
      z += b[pos];
      z = max(z, 0);
      z = min(z, x);
      pos++;
    }
    int sign = (pos % 2 ? 1 : -1);
    z += sign * (tim - a[pos - 1]);
    z = max(z, 0);
    z = min(z, x);
    if (!sign) z = x - z;
    printf("%d\n", z);
  }
  return 0;
}
