from math import ceil

def check(x):
    cnt = 0
    for a in A:
        cnt += ceil(a/x)-1
    return cnt <= K

N, K = map(int, input().split())
A = list(map(int, input().split()))

left = 0
right = max(A)
while left < right-1:
    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid
print(right) from math import ceil def check(x):
    cnt = 0
    for a in A:
        cnt += ceil(a/x)-1
    return cnt <= K check cnt = 0 cnt 0 for a in A:
        cnt += ceil(a/x)-1
     a A cnt += ceil(a/x)-1 cnt ceil(a/x)-1 ceil(a/x) ceil a/x a x 1 return cnt <= K cnt <= K cnt K x x N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split left = 0 left 0 right = max(A) right max(A) max A while left < right-1:
    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid left < right-1 left right-1 right 1 mid = (left+right)//2 mid (left+right)//2 left+right left right 2 if check(mid):
        right = mid
    else:
        left = mid check(mid) check mid right = mid right mid left = mid left mid print(right) print right K = map(int, input().split()) map(int, input().split()) K def check(x):
    cnt = 0
    for a in A:
        cnt += ceil(a/x)-1
    return cnt <= K def check(x):
    cnt = 0
    for a in A:
        cnt += ceil(a/x)-1
    return cnt <= K check right = max(A) max(A) right right = mid mid right left = mid mid left left = 0 0 left mid = (left+right)//2 (left+right)//2 mid N, K = map(int, input().split()) map(int, input().split()) N A = list(map(int, input().split())) list(map(int, input().split())) A
from math import ceil

def check(x):
    cnt = 0
    for a in A:
        cnt += ceil(a/x)-1
    return cnt <= K

N, K = map(int, input().split())
A = list(map(int, input().split()))

left = 0
right = max(A)
while left < right-1:
    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid
print(right)
