#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
 
using lint=long long;
using pint=pair<int,int>;
template<class T> using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

int main()
{
   int X,K; cin>>X>>K;
   vector<int> r(K+2);
   for(int i=1;i<=K;i++) cin>>r[i];
   r[K+1]=1e9;
   int Q; cin>>Q;
   vector<int> t(Q),a(Q);
   for(int i=0;i<Q;i++) cin>>t[i]>>a[i];

   for(int i=0;i<Q;i++){
      bool gravity=true;
      int A=a[i],B=X-a[i];
      for(int j=0;j<=K;j++){
         if(r[j+1]<t[i]){
            if(gravity){
               int d=min(A,r[j+1]-r[j]);
               A-=d; B+=d;
            }else{
               int d=min(B,r[j+1]-r[j]);
               B-=d; A+=d;
            }
            gravity^=1;
         }else{
            if(gravity){
               int d=min(A,t[i]-r[j]);
               A-=d; B+=d;
            }else{
               int d=min(B,t[i]-r[j]);
               B-=d; A+=d;
            }
            cout<<A<<endl;
            break;
         }
      }
   }
   return 0;
}
