#include <bits/stdc++.h>
#define int long long
#define all(v) v.begin(), v.end()

using namespace std;

const int MAXN = 1e5 + 5;
const int M = 998244353;

main() {
	int x;
	cin >> x;
	int k;
	cin >> k;
	vector<int> r(k);
	for (int i = 0; i < k; i++){
        cin >> r[i];
	}
	vector<pair<int, int>> f(k);
	f[0] = {x + r[0], -r[0]};
	for (int i = 1; i < k; i++){
        f[i] = {f[i - 1].second + (r[i] - r[i - 1]), f[i].first - (r[i] - r[i - 1])};
        cerr << f[i].first << ' ' << f[i].second << endl;
	}
	int q;
	cin >> q;
	int t, a;
	for (int i = 0; i < q; i++){
        cin >> t >> a;
        auto ind = upper_bound(all(r), t) - r.begin() - 1;
        if (ind == -1){
            cout << max(0LL, a - t) << endl;
            continue;
        }
        if (ind % 2 == 0){
            cout << max(0LL, f[ind].second + a) + max(0LL, t - r[ind])<< endl;
        } else {
            cout << f[ind].first - a + max(0LL, t - r[ind]) << endl;
        }
	}
	return 0;
}
