N,M = map(int,input().split()) W = list(map(int,input().split())) w = sum(W)/M A = [0]*N for i in range(N): A[i] = round(W[i]/w) print(*A)