import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)
m = (l+r)//2
ans = r
while r > l + 1:
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    m = (l+r)//2

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r) import math math N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K As = list(map(int, input().split())) As list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1 cut_num return math.ceil(a/cut_length) - 1 math.ceil(a/cut_length) - 1 math.ceil(a/cut_length) math.ceil math ceil a/cut_length a cut_length 1 a a cut_length cut_length """cut length N binary search
if cut num > K, search more longer cut length,
""" l = 1 l 1 r = max(As) r max(As) max As m = (l+r)//2 m (l+r)//2 l+r l r 2 ans = r ans r while r > l + 1:
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    m = (l+r)//2 r > l + 1 r l + 1 l 1 cut_num(a, m) for a in As for a in As a As for a in As cut_num(a, m) cut_num a m current_cut_num = sum([cut_num(a, m) for a in As]) current_cut_num sum([cut_num(a, m) for a in As]) sum [cut_num(a, m) for a in As] if current_cut_num <= K:
        r = m
    else:
        l = m
     current_cut_num <= K current_cut_num K r = m r m l = m l m m = (l+r)//2 m (l+r)//2 l+r l r 2 if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r) sum([cut_num(a, l) for a in As]) <= K sum([cut_num(a, l) for a in As]) sum [cut_num(a, l) for a in As] K print(l) print l print(r) print r K = map(int, input().split()) map(int, input().split()) K l = m m l r = max(As) max(As) r r = m m r ans = r r ans m = (l+r)//2 (l+r)//2 m N, K = map(int, input().split()) map(int, input().split()) N l = 1 1 l As = list(map(int, input().split())) list(map(int, input().split())) As def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1 def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1 cut_num m = (l+r)//2 (l+r)//2 m current_cut_num = sum([cut_num(a, m) for a in As]) sum([cut_num(a, m) for a in As]) current_cut_num
import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)
m = (l+r)//2
ans = r
while r > l + 1:
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    m = (l+r)//2

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r)