using System.Linq; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = long.Parse(line[1]); line = Console.ReadLine().Trim().Split(' '); var w = Array.ConvertAll(line, long.Parse); getAns(n, m, w); } static void getAns(int n, long m, long[] w) { var wsum = w.Sum(); if (wsum == 0) { Console.WriteLine(string.Join(" ", Enumerable.Repeat(0, n))); return; } var ans = new long[n]; for (int i = 0; i < n; i++) { ans[i] = m * w[i] / wsum; } Console.WriteLine(string.Join(" ", ans)); } }