<PREV Problem:
NEXT>
Solved by 720 users: ...
UserDateAttemptTimeCMSC
ggeorge19 feb 2017Ruby5200.3172 
VyatkaSU04 oct 2010Python500.4693 
zhuojie17 jan 2009Python501.3294 
bush09 mar 2006Ruby300.2997 
VyatkaSU04 oct 2010Python100.46101 
david_it2114 dec 2008Ruby200.21105 
mikl27 aug 2007C++300.05111 
pverutin07 feb 2008FPC700.02112 
WsemirZ05 jan 2008Kylix1000.02112 
WsemirZ22 jan 2008Kylix1200.02112 
Kuznetsov_S08 oct 2009Ruby2100.43113 
WsemirZ05 jan 2008Kylix400.02114 
mikl27 aug 2007C++200.05114 
bass11 feb 2013Ruby3501.92114 
Languages
C++
402
FPC
141
C
120
Java
28
Kylix
27
Ruby
10
Python
4
Perl
2
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 = 34.231.21.83