<PREV Problem:
NEXT>
Solved by 720 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Cables

Time limit = 5 second(s)

There are N cables of integer length. We need K cable pieces of equal integer length L. Cables cannot be merged (soldered). Find out maximum value of L.

Input The first line contains two integers N and K, 1 ≤ N, K ≤ 10000. Then lengths of cables go — N integer numbers, each less than 10000001, separated by white space (tab, spaces, newlines).

Output Output maximum value of L.

Input#1
3 4
1 100 34
Output#1
33
Input#2
1 2
101
Output#2
50
Input#3
5 5
1 2 4 6 8
Output#3
3
Input#4
6 6
1 2 3 5 8 13
Output#4
4

Author:
Semifinal ACM, St-Peterburg, 2001, problem C, http://neerc.ifmo.ru/past/2001.html.

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 54.81.197.127