n,m = map(int,input().split()) w = list(map(int,input().split())) all_ball = sum(w) if m != 0: ball = all_ball/m a = [] for i in range(n): ai = round(w[i]/ball) print(ai,end=' ') else: for i in range(n): print(0,end= ' ')