#C4920. Message Batching
Message Batching
Message Batching
You are given an integer (n) representing the number of days and an integer (m) representing the maximum number of messages a single batch can handle. You are also provided with an array of (n) integers where each integer denotes the number of messages sent on that day. Your task is to compute the number of batches required for each day using the formula:
$$\text{batches} = \left\lceil \frac{\text{messages}}{m} \right\rceil $$This can be computed using integer arithmetic as follows:
$$\text{batches} = \frac{\text{messages} + m - 1}{m} $$Output the result as a sequence of (n) integers separated by spaces.
inputFormat
The first line contains two integers (n) and (m), where (n) is the number of days and (m) is the maximum number of messages a batch can handle. The second line contains (n) space-separated integers representing the number of messages for each day.
outputFormat
Output a single line with (n) space-separated integers, where the (i)-th integer is the number of batches needed on day (i).## sample
3 5
3 7 9
1 2 2
</p>