import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Vector.Unboxed as Vec
import Debug.Trace as De

getIntList = map read . words <$> getLine


listToTriple abc =(a,b,c)
    where [a,b,c]=abc
main :: IO ()

fir (a,_,_)=a
sec (_,b,_)=b
trd (_,_,c)=c

canlogcut::Int->[Int]->Int ->Bool
canlogcut k as l = k >= (sum (map (\x ->  (x-1) `div` l )as) )

solve:: Int->[Int]->Int->Int ->Int
solve k as bmin bmax
    | bmin+1==bmax = bmax
    | (canlogcut k as bgen) = solve k as bmin bgen
    | otherwise = solve k as bgen bmax
        where bgen =(bmin+bmax) `div` 2


main = do
    [_,k]<-getIntList
    as<-getIntList
    putStrLn(show (solve k as 0 1000000005))



    

