n,m = map(int,input().split()) w = list(map(int,input().split())) if m==0: print(*[0]*n); exit() b = sum(w)/m a = [] for wi in w: a.append(round(wi/b)) print(*a)