n, k = [int(i) for i in input().split()]
woods = [int(i) for i in input().split()]


def k_cut_less_than(k, l, woods):
    kaisuu = 0
    for wood in woods:
        kaisuu += (wood-1) // l
    if kaisuu <= k:
        return False
    return True


# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき
import math


def binary_research(start, end,  function):
    if start == end:
        return start
    middle = math.ceil((start + end) / 2)
    if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
    return binary_research(start, end, function)

start=0
end=10**9
print(binary_research(start,end,k_cut_less_than)+1)

 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i n, k = [int(i) for i in input().split()] n [int(i) for i in input().split()] k int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i woods = [int(i) for i in input().split()] woods [int(i) for i in input().split()] def k_cut_less_than(k, l, woods):
    kaisuu = 0
    for wood in woods:
        kaisuu += (wood-1) // l
    if kaisuu <= k:
        return False
    return True


# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき k_cut_less_than kaisuu = 0 kaisuu 0 for wood in woods:
        kaisuu += (wood-1) // l
     wood woods kaisuu += (wood-1) // l kaisuu (wood-1) // l wood-1 wood 1 l if kaisuu <= k:
        return False
     kaisuu <= k kaisuu k return False False return True True k k l l woods woods import math math def binary_research(start, end,  function):
    if start == end:
        return start
    middle = math.ceil((start + end) / 2)
    if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
    return binary_research(start, end, function) binary_research if start == end:
        return start
     start == end start end return start start middle = math.ceil((start + end) / 2) middle math.ceil((start + end) / 2) math.ceil math ceil (start + end) / 2 start + end start end 2 if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
     function(k, middle, woods) function k middle woods start = middle start middle end = middle - 1 end middle - 1 middle 1 return binary_research(start, end, function) binary_research(start, end, function) binary_research start end function start start end end function function start=0 start 0 end=10**9 end 10**9 10 9 print(binary_research(start,end,k_cut_less_than)+1) print binary_research(start,end,k_cut_less_than)+1 binary_research(start,end,k_cut_less_than) binary_research start end k_cut_less_than 1 start=0 0 start def binary_research(start, end,  function):
    if start == end:
        return start
    middle = math.ceil((start + end) / 2)
    if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
    return binary_research(start, end, function) def binary_research(start, end,  function):
    if start == end:
        return start
    middle = math.ceil((start + end) / 2)
    if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
    return binary_research(start, end, function) binary_research end=10**9 10**9 end k = [int(i) for i in input().split()] [int(i) for i in input().split()] k woods = [int(i) for i in input().split()] [int(i) for i in input().split()] woods def k_cut_less_than(k, l, woods):
    kaisuu = 0
    for wood in woods:
        kaisuu += (wood-1) // l
    if kaisuu <= k:
        return False
    return True


# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき def k_cut_less_than(k, l, woods):
    kaisuu = 0
    for wood in woods:
        kaisuu += (wood-1) // l
    if kaisuu <= k:
        return False
    return True


# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき k_cut_less_than n, k = [int(i) for i in input().split()] [int(i) for i in input().split()] n
n, k = [int(i) for i in input().split()]
woods = [int(i) for i in input().split()]


def k_cut_less_than(k, l, woods):
    kaisuu = 0
    for wood in woods:
        kaisuu += (wood-1) // l
    if kaisuu <= k:
        return False
    return True


# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき
import math


def binary_research(start, end,  function):
    if start == end:
        return start
    middle = math.ceil((start + end) / 2)
    if function(k, middle, woods):
        start = middle
    else:
        end = middle - 1
    return binary_research(start, end, function)

start=0
end=10**9
print(binary_research(start,end,k_cut_less_than)+1)


