#include using namespace std; typedef long long ll; int main() { int n; ll m; cin >> n >> m; ll s = 0; ll w[1004]; for(int i = 0; i < n; i++){ cin >> w[i]; s += w[i]; } for(int i = 0; i < n; i++) cout << m * w[i] / s << " "; cout << endl; }