from heapq import heappush, heappop, heapify



n, k = list(map(int, input().split()))

a = list(map(int, input().split()))





def check(x):

    # 最長の丸太をx以下にできるか

    # 任意の丸太をx以下にできるか

    cnt = 0

    for ai in a:

        if ai > x:

            if ai % x == 0:

                cnt += ai // x - 1

            else:

                cnt += ai // x

    # print('check', x, cnt)

    return cnt <= k





lb = 0  # False

ub = max(a)  # True

while ub - lb > 1:

    mid = (ub + lb) // 2

    # print(mid, check(mid))

    if check(mid):

        ub = mid

    else:

        lb = mid



print(ub)

from heapq import heappush, heappop, heapify



n, k = list(map(int, input().split()))

a = list(map(int, input().split()))





def check(x):

    # 最長の丸太をx以下にできるか

    # 任意の丸太をx以下にできるか

    cnt = sum([(ai - 1) // x for ai in a])

    return cnt <= k





lb = 0  # False

ub = max(a)  # True

while ub - lb > 1:

    mid = (ub + lb) // 2

    # print(mid, check(mid))

    if check(mid):

        ub = mid

    else:

        lb = mid



print(ub)

from heapq import heappush, heappop, heapify

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))


def check(x):
    # 最長の丸太をx以下にできるか
    # 任意の丸太をx以下にできるか
    cnt = 0
    for ai in a:
        if ai > x:
            if ai % x == 0:
                cnt += ai // x - 1
            else:
                cnt += ai // x
    # print('check', x, cnt)
    return cnt <= k


lb = 0  # False
ub = max(a)  # True
while ub - lb > 1:
    mid = (ub + lb) // 2
    # print(mid, check(mid))
    if check(mid):
        ub = mid
    else:
        lb = mid
print(ub)

from heapq import heappush, heappop, heapify

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))


def check(x):
    # 最長の丸太をx以下にできるか
    # 任意の丸太をx以下にできるか
    cnt = sum([(ai - 1) // x for ai in a])
    return cnt <= k


lb = 0  # False
ub = max(a)  # True
while ub - lb > 1:
    mid = (ub + lb) // 2
    # print(mid, check(mid))
    if check(mid):
        ub = mid
    else:
        lb = mid
print(ub)

-    cnt = 0 -    for ai in a: -        if ai > x: -            if ai % x == 0: -                cnt += ai // x - 1 -            else: -                cnt += ai // x -    # print('check', x, cnt) +    cnt = sum([(ai - 1) // x for ai in a])