Queue
In civilized countries ticket offices are working at the train station, but the queue to them is just one. The service works as follows. Initially, when all the ticket offices are free, the first people from the queue go to the offices. The others are waiting their turn. As soon as someone is served and the corresponding office becomes free, the next person in the queue comes to this office. This continues until all the people will be served.
Find the time to serve all the clients.
Input
The first line contains two integers: the queue size and the number of ticket offices . positive integers are given in the second line. The -th number gives the time to serve the -th client in the queue.
Output
Print one integer — the time to serve all the people in the queue.