

void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  
  int x, k;
  rd(x); rd(k);
  auto r=readln.split.to!(int[]);
  int q; rd(q);

  int u=x, l=0;
  int j=0, p=0;
  int d=0, e=-1;
  while(q--){
    int t, a; rd(t, a);
    while(j<k && r[j]<=t){
      int dd=(r[j]-p)*e;
      p=r[j++]; e*=-1;
      u=min(x, max(0, u+dd));
      l=max(0, min(x, l+dd));
      d+=dd;
    }
    int y=a+d;
    y=min(u, max(l, y));
    y+=(t-p)*e;
    writeln(min(x, max(0, y)));
  }

}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}