import math

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

left = 0
right = max(A)

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
    if jk <= K:
        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 left = 0 left 0 right = max(A) right max(A) max A while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
    if jk <= K:
        right = mid
    else:
        left = mid right - left > 1 right - left right left 1 mid = (left + right) // 2 mid (left + right) // 2 left + right left right 2 jk = 0 jk 0 for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
     i range(N) range N jk += A[i] // mid - 1 jk A[i] // mid - 1 A[i] // mid A[i] A i mid 1 if A[i] % mid != 0: jk += 1
     A[i] % mid != 0 A[i] % mid A[i] A i mid 0 if jk <= K:
        right = mid
    else:
        left = mid jk <= K jk K right = mid right mid left = mid left mid print(right) print right N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K A = list(map(int, input().split())) list(map(int, input().split())) A jk = 0 0 jk left = 0 0 left jk += A[i] // mid - 1 A[i] // mid - 1 jk right = max(A) max(A) right right = mid mid right mid = (left + right) // 2 (left + right) // 2 mid left = mid mid left
import math

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

left = 0
right = max(A)

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
    if jk <= K:
        right = mid
    else:
        left = mid

print(right)