#include <bits/stdc++.h>
using namespace std;
int a[100005];
int t[100005];
int K[100005];
int check() {}
int main() {
  int n, m, T, k, X, Q;
  scanf("%d%d", &X, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &K[i]);
  }
  K[0] = 0;
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    scanf("%d%d", &t[i], &a[i]);
    int L = a[i], R = X - L;
    int cnt = 1;
    int F = -1;
    int pass = 0;
    while (cnt <= k && K[cnt] <= t[i]) {
      L += (K[cnt] - K[cnt - 1]) * F;
      R -= (K[cnt] - K[cnt - 1]) * F;
      if (L < 0) {
        L = 0;
      }
      if (L > X) {
        L = X;
      }
      if (R < 0) {
        R = 0;
      }
      if (R > X) {
        R = X;
      }
      pass += (K[cnt] - K[cnt - 1]);
      F *= -1;
      cnt++;
    }
    if (pass < t[i]) {
      L += (t[i] - pass) * F;
      R -= (t[i] - pass) * F;
      if (L < 0) {
        L = 0;
      }
      if (L > X) {
        L = X;
      }
      if (R < 0) {
        R = 0;
      }
      if (R > X) {
        R = X;
      }
    }
    printf("%d\n", L);
  }
  return 0;
}
