eolymp
bolt
Try our new interface for solving problems
Problems

Olympiad

Olympiad

$n$ teams arrived at Programming Competition, each team consists of $a_i~(1 \le i \le n)$ participants. For competition the classes were prepared with the same number $m$ of computers in each one. Find the minimum number of classes required for competition so that each class will contain participants from different teams only. That is, in any class cannot be more than one participant from one team. \InputFile The first line contains the numbers $n$ and $m$. The second line contains $n$ integers $a_i~(1 \le i \le n)$. All numbers are nonnegative and do not exceed $100$. \OutputFile Print one number --- the minimum required amount of classes.
Time limit 1 second
Memory limit 128 MiB
Input example #1
5 3
2 3 4 1 2
Output example #1
4
Author Матвейчук С.В.
Source 2015 III этап Всеукраинской олимпиады по информатике в Житомирской обл.