#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

int main() {
    int x;
    std::cin >> x;
    int k;
    std::cin >> k;
    std::vector<int> rot(k + 1);
    rot[0] = 0;
    for (int i = 1; i <= k; ++i) {
        std::cin >> rot[i];
    }
    std::vector<int> lb, ub;
    lb.push_back(0);
    ub.push_back(x);
    std::vector<std::pair<int, int>> vals;
    vals.push_back({0, x});
    for (int i = 1; i <= k; ++i) {
        int d = rot[i] - rot[i - 1];
        if (i % 2) {
            lb.push_back(lb[i - 1] - std::min(0, vals[i - 1].first - d));
            // ub.push_back(ub[i - 1] - std::max(0, vals[i - 1].second - d));
            ub.push_back(ub[i - 1]);
            vals.push_back({std::max(0, vals[i - 1].first - d),
                            std::max(0, vals[i - 1].second - d)});
        } else {
            //lb.push_back(lb[i - 1] + std::min(x, vals[i - 1].first + d));
            lb.push_back(lb[i - 1]);
            ub.push_back(ub[i - 1] + std::min(0, x - (vals[i - 1].second + d)));
            vals.push_back({std::min(x, vals[i - 1].first + d),
                            std::min(x, vals[i - 1].second + d)});
        }
    }
    rot.push_back(1000000001);
    lb.push_back(lb[rot.size() - 2]);
    ub.push_back(ub[rot.size() - 2]);
    vals.push_back(vals[rot.size() - 2]);

    int q;
    std::cin >> q;
    for (int i = 0; i < q; ++i) {
        int t, l;
        std::cin >> t >> l;
        int crot = std::lower_bound(rot.begin(), rot.end(), t) - rot.begin();
        if (t != 0)
            --crot;
        int ans;
        ans = std::min(ub[crot] - lb[crot], std::max(0, (l - lb[crot]))) + vals[crot].first;
        if (crot % 2 == 0) {
            ans = std::max(0, ans - (t - rot[crot]));
        } else {
            ans = std::min(x, ans + (t - rot[crot]));
        }
        std::cout << ans << "\n";
    }
}
