eolymp
bolt
Try our new interface for solving problems

Raft

Using \textbf{N} wooden logs of length \textbf{L_\{ i\}} (\textbf{i} = \textbf{1}..\textbf{N}) you need to construct a raft with \textbf{M} beams of equal length. Find the greatest possible length of the raft \textbf{P}. \InputFile In the first line of the values \textbf{N} and \textbf{M}, the second line the values of the array \textbf{L}. \OutputFile The value of \textbf{P}. All numeric values are natural, do not exceed \textbf{1000}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3 4
20 70 25
Output example #1
23