← 返回 doordash 的题目列表Distribute Orders to Dashers
类型:online_judge
There are n dashers and m restaurants. Each restaurant has a different number of orders. Each dasher can only handle one restaurant. In this case, find out the minimum number of orders each dasher needs to deliver to complete all orders. Assume the number of dashers is equal to the number of restaurants.
Input:
The first line contains two integers n and m, representing the number of dashers and restaurants.
The second line contains m integers, representing the number of orders for each restaurant.
Output:
The minimum maximum orders each dasher has to handle.
Example:
Input:
3 3
9 7 5
Output:
9
This means each dasher needs to handle a maximum of 9 orders.
Example
Input
3 3
9 7 5