#include<bits/stdc++.h>
using namespace std;

using ll=long long ;
int main(){
    ll x;
    ll k;
    cin>>x>>k;
    vector<ll> r(k+3);
    r[0]=0;
    r[k+1]=1e9+3;
    r[k+2]=1e9+10;
    for(int i=1;i<=k;i++){
        cin>>r[i];
    }
    
    int psize=sqrt(k)+1;
    
    vector<vector<ll>> pr;
    for(int i=0;i<r.size();){
        vector<ll> mp;
        for(int j=0;j<psize && i<r.size();i++,j++){
            mp.push_back(r[i]);
        }
        if(i!=r.size()-1) mp.push_back(r[i]);
        pr.push_back(mp);
    }
    vector<vector<pair<ll,ll>>> pacs(pr.size());
    vector<ll> aho(pr.size(),-1e11);
    for(int i=0;i<pr.size();i++){
        ll lb=0;
        ll ub=x+1;
        vector<pair<ll,ll>> lbs;
        lbs.push_back({0,0});
        vector<pair<ll,ll>> ubs;
        ll sum=0;
        for(int j=1;j<pr[i].size();j++){
            int sign=-(j%2);
            sum+=sign*(pr[i][j]-pr[i][j-1]);
            if(lb==ub) continue;
            if(sum<0 && lb<-sum){
                if(ub<-sum) lb=ub;
                else lb=-sum;
                lbs.push_back({lb,j});
            }
            else if(sum>0 && x-sum+1<ub){
                if(x-sum+1<lb) ub=lb;
                else ub=x-sum+1;
                ubs.push_back({ub,j});
            }
        }
        
        vector<ll> pacres(pr[i].size()+1);
        pacres[pr[i].size()]=x;
        for(int j=1;j<pr[i].size();j++){
            ll top=x;
            for(int k=j;k<pr[i].size();k++){
                top=max(0LL,top-(pr[i][k]-pr[i][k-1]));
                top=x-top;
            }   
            pacres[j]=top;
        }
        for(int j=0;j<int(lbs.size())-1;j++){
            pacs[i].push_back({lbs[j].first,pacres[lbs[i].second+1]});
        }
        if(lb!=ub){
            pacs[i].push_back({lb,-sum});
            aho[i]=lb;
        }
        for(int j=0;j<ubs.size();j++){
            pacs[i].push_back({ubs[j].first,pacres[ubs[i].second+1]});
        }
    }

    int q;
    cin>>q;
    for(int i=0;i<q;i++){
        ll t,a;
        cin>>t>>a;
        bool istopa=(lower_bound(r.begin(),r.end(),0)-r.begin())%2;
        bool out=false;
        ll top=a;
        for(int j=0;j<pr.size();j++){
            if(t<pr[j].back()){
                for(int k=j;k<pr[i].size();k++){
                    if(pr[i][k]<t){
                        top=max(0LL,top-(t-pr[j][k-1]));
                        cout<<(istopa ? top : x-top)<<endl;
                        goto aholavel;
                    }
                    top=max(0LL,top-(pr[j][k]-pr[j][k-1]));
                    top=x-top;
                }
            }
            else{
                auto val=*lower_bound(pacs[j].begin(),pacs[j].end(),{top,-100000000000LL});;
                if(aho[j]==val.first){
                    top+=val.second;
                }
                else{
                    top=val.second;
                }
            }
        }
        aholavel:
        int xxx;
    }
    return 0;
}