def solve(): N,K=map(int,input().split()) A=list(map(int,input().split())) S=[-1]*N L,R=1,N i=0; j=0 while iA[i+1]: for k in range(j,i+1): S[k]=L L+=1 j=i+1 elif A[i]