INF=10**18 n,m=map(int,input().split()) a=list(map(int,input().split())) dp=[[-INF]*(m+1) for i in range(n)] def val(x,idx): if idx%2==0: return x else: return -x for j in range(2): dp[0][j]=val(a[0],j) for i in range(n-1): for j in range(m+1): if dp[i+1][j] < dp[i][j]+val(a[i+1],j): dp[i+1][j] = dp[i][j]+val(a[i+1],j) if j0: print(0) cnt+=1 for i in range(m-cnt): print(n)