import math
n,k=map(int, input().split())
a=list(map(int, input().split()))
right=max(a)
left=0
def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k
while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        right=mid
    else:
        left=mid
print(right) import math math 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 right=max(a) right max(a) max a left=0 left 0 def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k cutable count=0 count 0 for i in a:
        count+=math.ceil(i/x)-1
     i a count+=math.ceil(i/x)-1 count math.ceil(i/x)-1 math.ceil(i/x) math.ceil math ceil i/x i x 1 return count<=k count<=k count k a a x x while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        right=mid
    else:
        left=mid right>left+1 right left+1 left 1 mid=(right+left)//2 mid (right+left)//2 right+left right left 2 if cutable(a,mid):
        right=mid
    else:
        left=mid cutable(a,mid) cutable a mid right=mid right mid left=mid left mid print(right) print right left=mid mid left a=list(map(int, input().split())) list(map(int, input().split())) a right=mid mid right k=map(int, input().split()) map(int, input().split()) k def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k cutable right=max(a) max(a) right mid=(right+left)//2 (right+left)//2 mid n,k=map(int, input().split()) map(int, input().split()) n left=0 0 left
import math
n,k=map(int, input().split())
a=list(map(int, input().split()))
right=max(a)
left=0
def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k
while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        right=mid
    else:
        left=mid
print(right)