#include <bits/stdc++.h>
using namespace std;
template <size_t index, typename... Ts>
struct print_tuple {
  void operator()(ostream& os, const tuple<Ts...>& t) {
    os << '(' << get<index>(t) << ')';
    print_tuple<index + 1, Ts...>()(os, t);
  }
};
template <typename... Ts>
struct print_tuple<sizeof...(Ts), Ts...> {
  void operator()(ostream&, const tuple<Ts...>&) {}
};
template <typename... Ts>
ostream& operator<<(ostream& os, const tuple<Ts...>& t) {
  os << '[';
  print_tuple<0, Ts...>()(os, t);
  os << ']';
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& t) {
  return os << make_tuple(t.first, t.second);
}
constexpr size_t print_limit = 10;
template <typename It>
void print(ostream& os, It begin, It end, size_t len) {
  size_t count = 0;
  os << "{";
  while (begin != end && count < print_limit) {
    os << "(" << *begin << ")";
    count++;
    begin++;
  }
  if (print != end) os << "... " << len << " total";
  os << "}";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& t) {
  print(os, t.begin(), t.end(), t.size());
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const map<T1, T2>& t) {
  print(os, t.begin(), t.end(), t.size());
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& t) {
  print(os, t.begin(), t.end(), t.size());
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const unordered_map<T1, T2>& t) {
  print(os, t.begin(), t.end(), t.size());
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const unordered_set<T>& t) {
  print(os, t.begin(), t.end(), t.size());
  return os;
}
constexpr size_t MAXX = 10000;
struct P {
  int64_t x;
  int64_t y;
};
namespace std {
template <>
struct hash<P> {
  size_t operator()(const P& p) const {
    auto h = hash<int64_t>();
    return 13 + h(p.x) ^ h(p.y);
  }
};
}  // namespace std
struct L {
  P a;
  P b;
};
namespace std {
template <>
struct hash<L> {
  size_t operator()(const L& l) const {
    auto h = hash<P>();
    return 42 + h(l.a) ^ h(l.b);
  }
};
}  // namespace std
bool operator==(P p1, P p2) { return p1.x == p2.x && p1.y == p2.y; }
bool operator==(L l1, L l2) { return l1.a == l2.a && l1.b == l2.b; }
bool parallel_line(P p1, P p2, P p3, P p4) {
  auto x1 = p2.x - p1.x, x2 = p4.x - p3.x, y1 = p2.y - p1.y, y2 = p4.y - p3.y;
  return x1 * y2 == x2 * y1;
}
bool same_line(P p1, P p2, P p3) { return parallel_line(p1, p2, p1, p3); }
using A = int64_t;
int64_t x;
vector<A> rs;
struct Chart {
  vector<A> ch;
  vector<A> ch_min;
  vector<A> ch_max;
  bool bouncing;
  void init(A a, bool _bouncing) {
    ch = {a};
    ch_min = {a};
    ch_max = {a};
    bouncing = _bouncing;
  }
} ch_x, ch_0, ch_a;
int64_t min(int64_t a, int64_t b) { return a < b ? a : b; }
int64_t max(int64_t a, int64_t b) { return a > b ? a : b; }
void update_chart(Chart& ch, A rd) {
  if (ch.ch.size() % 2 == 1) {
    auto v = ch.ch.back() - rd;
    ch.ch.push_back(ch.bouncing ? max(0, v) : v);
  } else {
    auto v = ch.ch.back() + rd;
    ch.ch.push_back(ch.bouncing ? min(x, v) : v);
  }
  ch.ch_min.push_back(min(ch.ch_min.back(), ch.ch.back()));
  ch.ch_max.push_back(max(ch.ch_max.back(), ch.ch.back()));
}
void make_charts() {
  ch_0.init(0, true);
  ch_x.init(x, true);
  ch_a.init(0, false);
  for (size_t i = 1; i < rs.size(); i++) {
    update_chart(ch_0, rs[i] - rs[i - 1]);
    update_chart(ch_a, rs[i] - rs[i - 1]);
    update_chart(ch_x, rs[i] - rs[i - 1]);
  }
}
A calc(A v1, A d, size_t ri) {
  if (ri % 2 == 0) return max(0, v1 - d);
  return min(x, v1 + d);
}
void go() {
  A k, q;
  cin >> x >> k;
  rs.push_back(0);
  while (k--) {
    A r;
    cin >> r;
    rs.push_back(r);
  }
  make_charts();
  cin >> q;
  while (q--) {
    A t, a;
    cin >> t >> a;
    const size_t ri = (upper_bound(rs.begin(), rs.end(), t) - rs.begin()) - 1u;
    if (ch_a.ch_min[ri] < -a) {
      cout << calc(ch_0.ch[ri], t - rs[ri], ri) << endl;
    } else if (ch_a.ch_max[ri] > x - a) {
      cout << calc(ch_x.ch[ri], t - rs[ri], ri) << endl;
    } else
      cout << calc(ch_a.ch[ri] + a, t - rs[ri], ri) << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  go();
}
