#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

class MaxFinder {
    set<P> s;
public:
    MaxFinder() {}
    void add(ll x, ll v) {
        while (s.begin() != s.end()) {
            if (s.begin()->first > x) break;
            s.erase(s.begin());
        }
        s.insert(P(x, v));
    }
    ll find(ll x) {
        auto it = s.lower_bound(P(x, -linf));
        if (it == s.end()) return -linf;
        return it->second;
    }
};
int main() {
    // MaxFinder mf;
    // mf.add(3, 5);
    // mf.add(10, 30);
    // mf.add(5, 40);
    // cout << mf.find(0) << endl;
    // cout << mf.find(3) << endl;
    // cout << mf.find(4) << endl;
    // cout << mf.find(5) << endl;
    // cout << mf.find(12) << endl;
    // return 0;
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll X, K; cin >> X >> K;
    vector<ll> r(K); cin >> r;
    ll Q; cin >> Q;
    vector<tuple<ll,ll,ll>> q;
    rep(i, Q) {
        ll t, a; cin >> t >> a;
        q.pb(tuple<ll,ll,ll>(t, a, i));
    }
    sort(all(q));
    vector<ll> ans(Q, -1);
    ll rp = 0;
    MaxFinder maxu, maxd;
    vector<ll> h(K+1, 0);
    auto f = [&](ll t, ll a, bool f = false) {
        ll pos = -linf;
        chmax(pos, maxd.find(a));
        chmax(pos, maxu.find(-a));
        ll h0 = a + h[rp];
        // if (f) cout << "!" << pos << endl;
        if (pos >= 0) {
            h0 = pos % 2 == 0 ? 0 : X;
            h0 += h[rp] - h[pos+1];
        }
        if (rp > 0) {
            t -= r[rp-1];
        }
        return h0 + t * (rp % 2 == 0 ? -1 : 1);
    };
    each(query, q) {
        ll t, a, idx; tie(t, a, idx) = query;
        while (rp < K && t >= r[rp]) {
            // cout << "update: " << rp << endl;
            if (rp % 2 == 0) {
                ll lb = -1, ub = X+1;
                rep(t, 30) {
                    ll m = (lb + ub) / 2;
                    if (f(r[rp], m) <= 0) {
                        lb = m;
                    }
                    else {
                        ub = m;
                    }
                }
                // cout << "d: " << lb << endl;
                maxd.add(lb, rp);
            }
            else {
                ll lb = -1, ub = X+1;
                rep(t, 30) {
                    ll m = (lb + ub) / 2;
                    if (f(r[rp], m) >= X) {
                        ub = m;
                    }
                    else {
                        lb = m;
                    }
                }
                // cout << "u: " << ub << endl;
                maxu.add(-ub, rp);
            }
            ll d = rp == 0 ? r[0] : r[rp] - r[rp-1];
            h[rp+1] = h[rp] + (rp % 2 == 0 ? -1 : 1) * d;
            ++rp;
        }
        ans[idx] = max(0LL, min(X, f(t, a)));
        // cout << t << " " << a << " " << ans[idx] << endl;
    }
    rep(i, Q) cout << ans[i] << endl;
}


Measured memory_bytes: 6128