import math

def solve(x):
    cnt = 0
    for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
    if cnt > k:
        return False
    else:
        return True


n=0
k=0
li=[]

if __name__ == "__main__":
    n,k = map(int, input().split())
    li = list(map(int,input().split()))
    left = 1
    right = 10**9
    ans = 0
    while right >= left:
        mid = left + (right - left)//2
        flag = solve(mid)
        if flag:
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
    print(ans) import math math def solve(x):
    cnt = 0
    for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
    if cnt > k:
        return False
    else:
        return True solve cnt = 0 cnt 0 for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
     i li k_i = math.ceil(i/x) - 1 k_i math.ceil(i/x) - 1 math.ceil(i/x) math.ceil math ceil i/x i x 1 cnt += k_i cnt k_i if cnt > k:
        return False
    else:
        return True cnt > k cnt k return False False return True True x x n=0 n 0 k=0 k 0 li=[] li [] if __name__ == "__main__":
    n,k = map(int, input().split())
    li = list(map(int,input().split()))
    left = 1
    right = 10**9
    ans = 0
    while right >= left:
        mid = left + (right - left)//2
        flag = solve(mid)
        if flag:
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
    print(ans) __name__ == "__main__" __name__ "__main__" n,k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k li = list(map(int,input().split())) li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split left = 1 left 1 right = 10**9 right 10**9 10 9 ans = 0 ans 0 while right >= left:
        mid = left + (right - left)//2
        flag = solve(mid)
        if flag:
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
     right >= left right left mid = left + (right - left)//2 mid left + (right - left)//2 left (right - left)//2 right - left right left 2 flag = solve(mid) flag solve(mid) solve mid if flag:
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
     flag ans = mid ans mid right = mid - 1 right mid - 1 mid 1 left = mid + 1 left mid + 1 mid 1 print(ans) print ans left = 1 1 left n=0 0 n def solve(x):
    cnt = 0
    for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
    if cnt > k:
        return False
    else:
        return True def solve(x):
    cnt = 0
    for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
    if cnt > k:
        return False
    else:
        return True solve mid = left + (right - left)//2 left + (right - left)//2 mid ans = mid mid ans k = map(int, input().split()) map(int, input().split()) k left = mid + 1 mid + 1 left li = list(map(int,input().split())) list(map(int,input().split())) li right = mid - 1 mid - 1 right n,k = map(int, input().split()) map(int, input().split()) n ans = 0 0 ans flag = solve(mid) solve(mid) flag k=0 0 k li=[] [] li right = 10**9 10**9 right
import math

def solve(x):
    cnt = 0
    for i in li:
        k_i = math.ceil(i/x) - 1
        cnt += k_i
    if cnt > k:
        return False
    else:
        return True


n=0
k=0
li=[]

if __name__ == "__main__":
    n,k = map(int, input().split())
    li = list(map(int,input().split()))
    left = 1
    right = 10**9
    ans = 0
    while right >= left:
        mid = left + (right - left)//2
        flag = solve(mid)
        if flag:
            ans = mid
            right = mid - 1
        else:
            left = mid + 1
    print(ans)
