Codey and Takoyaki
https://www.hackerrank.com/contests/codenection-2024-test/challenges/cn24-test
Question
Codey runs a popular takoyaki (a Japanese octopus ball) shop. One morning, it finds n customers already waiting in line, each requesting ai takoyaki balls. However, it hasn't started cooking any takoyaki yet.
The grill pan can cook exactly 9 takoyaki balls in one use. For efficiency, Codey always cook at full capacity whenever he uses the pan.
Assuming the number of takoyaki balls Codey have currently is 0, what is the minimum number of times it needs to use his grill pan to fulfill all orders?
Input Format
The first line contains a single integer n - the number of customers in the queue.
The second line contains n space-separated integers, a1, a2, ... , an , where ai represents the number of takoyaki balls the -i-th customer wants to order.
Constraints
Output Format
Output a single integer, the minimum number of times Codey needs to use the grill pan to fulfill all customer orders.
Sample Inputs:
Last updated