#C11859. Minimum Coffee Bean Bags
Minimum Coffee Bean Bags
Minimum Coffee Bean Bags
You are given the number of espresso (e), latte (l), and cappuccino (c) orders, as well as the weight in grams (m) of beans in each bag. Each espresso requires 5 grams, each latte requires 7 grams, and each cappuccino requires 9 grams of coffee beans. The total amount of beans required is computed as $$T = 5e + 7l + 9c$$. You need to determine the minimum number of bags needed to meet or exceed the total required beans, i.e. compute $$\lceil \frac{T}{m} \rceil$$.
inputFormat
Input is read from standard input. The input consists of a single line containing four space-separated integers: e, l, c, and m, where:
- e: number of espressos
- l: number of lattes
- c: number of cappuccinos
- m: grams of beans in each bag
outputFormat
Output a single integer to standard output representing the minimum number of bags of beans required.## sample
5 3 2 50
2