import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

main = do
  li <- BS.getLine
  let [n,k] = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  li <- BS.getLine
  let as = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute n k as
  print ans

compute :: Int -> Int -> [Int] -> Int
compute n k as
  | k == 0 = amax
  | c1 <= k = 1
  | True = loop 1 amax
  where
    c1 = cutCount1 n as -- 長さ1に切り刻む回数
    amax = maximum as   -- 一度も切らないときの最大長
    loop a b
      | a+1 >= b = b
      | c > k = loop m b
      | True  = loop a m
      where
        m = div (a+b) 2
        c = cutCount m as

cutCount :: Int -> [Int] -> Int
cutCount x as = sum [div (a + x - 1) x - 1 | a <- as]

cutCount1 n as = sum as - n

-- 解説を忠実に実装