#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { ll N, M, S = 0; cin >> N >> M; vector W(N); rep(i, 0, N) { cin >> W[i]; S += W[i]; } rep(i, 0, N) { if (S == 0) cout << 0; else cout << M * W[i] / S; if (i == N - 1) cout << endl; else cout << " "; } }