#C11266. Minimal Days to Water All Flowers
Minimal Days to Water All Flowers
Minimal Days to Water All Flowers
Given the number of flower types, their individual water requirements, and the daily water supply capacity, determine the minimal number of days needed to water all the flowers if water can be distributed arbitrarily among them.
The task is to compute the smallest number of days so that the total water required is met, which mathematically can be represented using the ceiling function:
$$ \lceil \frac{\sum_{i=1}^{n} a_i}{T} \rceil $$
Here, \(a_i\) represents the water requirement for the \(i\)-th flower and \(T\) is the water available per day.
inputFormat
Input is read from standard input. The first line contains an integer \(n\) representing the number of flower types. The second line contains \(n\) space-separated integers where the \(i\)-th integer denotes the water requirement for the \(i\)-th flower. The third line contains an integer \(T\) representing the amount of water available per day.
outputFormat
Output the minimal number of days required to water all the flower types to standard output.
## sample3
4 5 6
3
5