Masala #D386OYZTUA

Xotira 32 MB Vaqt 1000 ms
14

The Supermarket Queue

There is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate the total time required for all the customers to check out!

 


Kiruvchi ma'lumotlar:
  • customers: an array of positive integers representing the queue. Each integer represents a customer, and its value is the amount of time they require to check out.
  • n: a positive integer, the number of checkout tills.

Chiquvchi ma'lumotlar:

The function should return an integer, the total time required.


 


Misollar
# input.txt output.txt
1
1 2 3 4
1
10
Izoh:

Please look at the examples and clarifications below, to ensure you understand the task correctly :)