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)

while r > l + 1:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    

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 while r > l + 1:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
     r > l + 1 r l + 1 l 1 m = (l+r)//2 m (l+r)//2 l+r l r 2 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 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 N, K = map(int, input().split()) map(int, input().split()) N 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 K = map(int, input().split()) map(int, input().split()) K 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 l = 1 1 l r = m m r As = list(map(int, input().split())) list(map(int, input().split())) As r = max(As) max(As) r l = m m l
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)

while r > l + 1:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    

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