#include <bits/stdc++.h>
using namespace std;
int maxAmount;
int rNum;
int rTimeArray[100001];
int calcSand(int eTime, int partsAInSand) {
  bool isReturn = false;
  for (long long i = (0); i < (rNum); ++i) {
    if (rTimeArray[i] < eTime) {
      int diffTime =
          (i > 0) ? rTimeArray[i] - rTimeArray[i - 1] : rTimeArray[i];
      isReturn ? partsAInSand += diffTime : partsAInSand -= diffTime;
      if (partsAInSand < 0) partsAInSand = 0;
      if (partsAInSand > maxAmount) partsAInSand = maxAmount;
      isReturn = !isReturn;
    } else {
      int diffTime = (i > 0) ? eTime - rTimeArray[i - 1] : eTime;
      isReturn ? partsAInSand += diffTime : partsAInSand -= diffTime;
      if (partsAInSand < 0) partsAInSand = 0;
      if (partsAInSand > maxAmount) partsAInSand = maxAmount;
      break;
    }
    if (eTime > rTimeArray[rNum - 1]) {
      int diffTime = eTime - rTimeArray[rNum - 1];
      isReturn ? partsAInSand += diffTime : partsAInSand -= diffTime;
      if (partsAInSand < 0) partsAInSand = 0;
      if (partsAInSand > maxAmount) partsAInSand = maxAmount;
    }
  }
  return partsAInSand;
}
int main(void) {
  cin >> maxAmount;
  cin >> rNum;
  for (long long i = (0); i < (rNum); ++i) {
    cin >> rTimeArray[i];
  }
  int queryNum;
  cin >> queryNum;
  for (long long i = (0); i < (queryNum); ++i) {
    int eTime, partsAInSand;
    cin >> eTime >> partsAInSand;
    cout << calcSand(eTime, partsAInSand) << endl;
  }
  return 0;
}
