ll@N,@A;set I{N},D{N};rep(i,N-1){ll@B;if(AB)D.insert(i);A=B;}ll@Q;rep(Q){ll@l,@r,s,t;s=*D.lower_bound(l)>=r,t=*I.lower_bound(l)>=r;wt(s,t);}