ll@N,@A[N],@Q;setI{N},D{N};rep(i,N-1){if(A[i]A[i+1])D.insert(i);}while(Q--){ll@l,@r,s,t;s=*D.lower_bound(l)>=r,t=*I.lower_bound(l)>=r;wt(s,t);}