import math

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

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

middle = math.ceil(max(a) / 2)
oldMiddle = 0
h = middle // 2
rightMin = max(a)

while h > 0:
    cut = 0
    if middle == 0:
        middle = 1
        break
    for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
    h = math.ceil(abs(middle - oldMiddle) / 2)
    oldMiddle = middle
    if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h

print(middle) import math math n,k = list(map(int,input().split())) n list(map(int,input().split())) list 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 middle = math.ceil(max(a) / 2) middle math.ceil(max(a) / 2) math.ceil math ceil max(a) / 2 max(a) max a 2 oldMiddle = 0 oldMiddle 0 h = middle // 2 h middle // 2 middle 2 rightMin = max(a) rightMin max(a) max a while h > 0:
    cut = 0
    if middle == 0:
        middle = 1
        break
    for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
    h = math.ceil(abs(middle - oldMiddle) / 2)
    oldMiddle = middle
    if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h h > 0 h 0 cut = 0 cut 0 if middle == 0:
        middle = 1
        break
     middle == 0 middle 0 middle = 1 middle 1 break for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
     i range(n) range n cut += math.ceil(a[i] / middle) - 1 cut math.ceil(a[i] / middle) - 1 math.ceil(a[i] / middle) math.ceil math ceil a[i] / middle a[i] a i middle 1 h = math.ceil(abs(middle - oldMiddle) / 2) h math.ceil(abs(middle - oldMiddle) / 2) math.ceil math ceil abs(middle - oldMiddle) / 2 abs(middle - oldMiddle) abs middle - oldMiddle middle oldMiddle 2 oldMiddle = middle oldMiddle middle if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h cut <= k cut k if (middle - h == rightMin):
            break
         middle - h == rightMin middle - h middle h rightMin break middle -= h middle h rightMin = middle rightMin middle middle += h middle h print(middle) print middle a = list(map(int,input().split())) list(map(int,input().split())) a rightMin = middle middle rightMin h = middle // 2 middle // 2 h cut += math.ceil(a[i] / middle) - 1 math.ceil(a[i] / middle) - 1 cut middle += h h middle cut = 0 0 cut middle -= h h middle middle = math.ceil(max(a) / 2) math.ceil(max(a) / 2) middle middle = 1 1 middle oldMiddle = middle middle oldMiddle rightMin = max(a) max(a) rightMin h = math.ceil(abs(middle - oldMiddle) / 2) math.ceil(abs(middle - oldMiddle) / 2) h k = list(map(int,input().split())) list(map(int,input().split())) k oldMiddle = 0 0 oldMiddle n,k = list(map(int,input().split())) list(map(int,input().split())) n
import math

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

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

middle = math.ceil(max(a) / 2)
oldMiddle = 0
h = middle // 2
rightMin = max(a)

while h > 0:
    cut = 0
    if middle == 0:
        middle = 1
        break
    for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
    h = math.ceil(abs(middle - oldMiddle) / 2)
    oldMiddle = middle
    if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h

print(middle)