#include #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::vector; using ll = long long; int main() { int n, m; cin >> n >> m; vector w(n); rep(i, n) cin >> w[i]; ll s = 0; rep(i, n) s += w[i]; if (s == 0) { rep(i, n) cout << 0 << ' '; return 0; } vector a(n); rep(i, n) a[i] = w[i] * m / s; rep(i, n) cout << a[i] << ' '; return 0; }