Running Count of Late Deliveries
Riverbend Supply's dispatch screen carries a late-delivery tally that ticks up through the shift, so the supervisor can see when the trouble started rather than only how bad the day ended up. A delivery counts as late when it took strictly more than 30 minutes; a delivery in exactly 30 minutes is on time. The screen shows one tally figure per delivery, in the order the deliveries were completed, and each figure is the tally after that delivery has been logged.
Task: Print the late-delivery tally after each delivery.
Input
The first line holds a single integer n, the number of deliveries. Each of the next n lines holds one delivery's duration in minutes, which may carry decimals.
Output
One line holding n tally figures, in delivery order, separated by single spaces. Write each as a whole number. The tally never falls, and it starts at 0 before any late delivery has occurred.
Example:
Input:
4
20
35
40
25
Output:
0 1 2 2
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in