import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); long M = sc.nextInt(); long[] W = new long[(int)N]; long wsum = 0; for( int i = 0; i < N; i++ ) { W[i] = sc.nextInt(); wsum += W[i]; } for( int i = 0; i < N; i++ ) { System.out.print( wsum == 0 ? 0 : (M*W[i])/wsum ); if( i < N-1 ) System.out.print(" "); } System.out.println(); } }