import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))
a = 0
b = max(logs)
b_memo = set()
count=0
flg =0
while b-a > 1:
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.ceil(i/c)-1)
    if sum(times) > K:
        a = c
    else:
        b = c

print(b) import math math N, K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K logs = list(map(int,input().split())) logs list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split a = 0 a 0 b = max(logs) b max(logs) max logs b_memo = set() b_memo set() set count=0 count 0 flg =0 flg 0 while b-a > 1:
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.ceil(i/c)-1)
    if sum(times) > K:
        a = c
    else:
        b = c b-a > 1 b-a b a 1 c = (a+b)//2 c (a+b)//2 a+b a b 2 times = [] times [] for i in logs:
        times.append(math.ceil(i/c)-1)
     i logs times.append(math.ceil(i/c)-1) times.append times append math.ceil(i/c)-1 math.ceil(i/c) math.ceil math ceil i/c i c 1 if sum(times) > K:
        a = c
    else:
        b = c sum(times) > K sum(times) sum times K a = c a c b = c b c print(b) print b logs = list(map(int,input().split())) list(map(int,input().split())) logs b_memo = set() set() b_memo times = [] [] times K = map(int,input().split()) map(int,input().split()) K a = 0 0 a count=0 0 count c = (a+b)//2 (a+b)//2 c N, K = map(int,input().split()) map(int,input().split()) N flg =0 0 flg b = c c b b = max(logs) max(logs) b a = c c a
import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))
a = 0
b = max(logs)
b_memo = set()
count=0
flg =0
while b-a > 1:
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.ceil(i/c)-1)
    if sum(times) > K:
        a = c
    else:
        b = c

print(b)