def main(): N, M = map(int, input().split()) W = list(map(int, input().split())) sum_weight = sum(W) print(*map(lambda weight: round(M * weight / sum_weight), W)) if __name__ == "__main__": main()