#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, K, t, a, Q, ri;
  int r[100000] = {0}, temp = 0;
  cin >> X;
  cin >> K;
  for (int i = 0; i < K; i++) {
    cin >> ri;
    r[i] = ri - temp;
    temp = ri;
  }
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> t >> a;
    for (int j = 0; j < K; j++) {
      if ((t - r[j]) <= 0) {
        if (a - t >= 0 && j % 2 == 0) {
          cout << a - t << endl;
        } else if (a - t < 0 && j % 2 == 0) {
          cout << 0 << endl;
        } else if (a + t <= X && j % 2 != 0) {
          cout << a + t << endl;
        } else if (a + t > X && j % 2 != 0) {
          cout << X << endl;
        }
        break;
      }
      if (j == K - 1) {
        if (a - t >= 0 && j % 2 != 0) {
          cout << a - t << endl;
        } else if (a - t < 0 && j % 2 != 0) {
          cout << 0 << endl;
        } else if (a + t <= X && j % 2 == 0) {
          cout << a + t << endl;
        } else if (a + t > X && j % 2 == 0) {
          cout << X << endl;
        }
        break;
      }
      if (a - r[j] >= 0 && j % 2 == 0) {
        a -= r[j];
      } else if (a - r[j] < 0 && j % 2 == 0) {
        a = 0;
      } else if (a + r[j] <= X && j % 2 != 0) {
        a += r[j];
      } else if (a + r[j] > X && j % 2 != 0) {
        a = X;
      }
      t -= r[j];
    }
  }
  return 0;
}
