import math

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

l = 1
r = 10**9+1

while l < r:
    mid = (l+r)//2
    count = 0
    for i in range(n):
        if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

    if count <= k:
        r = mid
    else:
        l = mid+1


print(l) 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 l = 1 l 1 r = 10**9+1 r 10**9+1 10**9 10 9 1 while l < r:
    mid = (l+r)//2
    count = 0
    for i in range(n):
        if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

    if count <= k:
        r = mid
    else:
        l = mid+1 l < r l r mid = (l+r)//2 mid (l+r)//2 l+r l r 2 count = 0 count 0 for i in range(n):
        if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

     i range(n) range n if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

     A[i] > mid A[i] A i mid count += math.ceil(A[i]/mid-1) count math.ceil(A[i]/mid-1) math.ceil math ceil A[i]/mid-1 A[i]/mid A[i] A i mid 1 if count <= k:
        r = mid
    else:
        l = mid+1 count <= k count k r = mid r mid l = mid+1 l mid+1 mid 1 print(l) print l n, k = map(int, input().split()) map(int, input().split()) n count = 0 0 count l = 1 1 l mid = (l+r)//2 (l+r)//2 mid r = mid mid r k = map(int, input().split()) map(int, input().split()) k count += math.ceil(A[i]/mid-1) math.ceil(A[i]/mid-1) count A = list(map(int, input().split())) list(map(int, input().split())) A r = 10**9+1 10**9+1 r l = mid+1 mid+1 l
import math

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

l = 1
r = 10**9+1

while l < r:
    mid = (l+r)//2
    count = 0
    for i in range(n):
        if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

    if count <= k:
        r = mid
    else:
        l = mid+1


print(l)
