GUVI
Back

Remaining Weight

Created 2 years ago
20 Views
1 Comments
Subham7TC2Ke
@Subham7TC2Ke
Subham7TC2Ke
@Subham7TC2KeProfile is locked. Login
Jack loves to play baseball. As he is a good hitter, so he needs to carry more balls for good practice. There are balls of two types which he uses for playing. These are White and Black balls. When he was packing his kit he found that the weight is too much, so he decided to remove some balls from the bag. Let the number of White balls he has be \(W\) and Black balls he has \(B\) currently in the bag. There is a weight for each type of ball. Let \(W_w\) be the weight of each White ball and the weight of each Black ball be \(W_b\). He decided to remove exactly \(K\) balls from the bag. He wants the weight of the bag as minimum as possible by removing exactly \(K\) balls from the bag. Help him find the minimum weight he can have. INPUT: The first line of input contains three integers W, B, K denoting the number of white balls, number of red balls, and number of balls to be removed. \((1 \le W, B \le 10^8, 0 \le K \le A + B)\). The next line contains two integers \(W_w, W_b\) denoting the weight of White and Black balls. \((1 \le W_w, W_b \le 10^8)\). OUTPUT: Print a single line containing a single integer denoting the minimum weight possible.
Comments
Please login to comment.
 
Powered by habitate.io Habitate