import sys , math

N,K=list(map(int, input().split()))
Ws=list(map(int, input().split()))
Ws.sort(reverse=True)

l=0
r=10**9

def check (m):
    now=0
    for i in range(N):
        now += (Ws[i] - 1) // m
    return now <= K

while r - l > 1:
    m = ( l + r ) // 2

    if check(m):
        r = m
    else:
        l = m
print(r)  import sys , math sys 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 Ws=list(map(int, input().split())) Ws list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split Ws.sort(reverse=True) Ws.sort Ws sort reverse=True reverse True l=0 l 0 r=10**9 r 10**9 10 9 def check (m):
    now=0
    for i in range(N):
        now += (Ws[i] - 1) // m
    return now <= K check now=0 now 0 for i in range(N):
        now += (Ws[i] - 1) // m
     i range(N) range N now += (Ws[i] - 1) // m now (Ws[i] - 1) // m Ws[i] - 1 Ws[i] Ws i 1 m return now <= K now <= K now K m m while r - l > 1:
    m = ( l + r ) // 2

    if check(m):
        r = m
    else:
        l = m r - l > 1 r - l r l 1 m = ( l + r ) // 2 m ( l + r ) // 2 l + r l r 2 if check(m):
        r = m
    else:
        l = m check(m) check m r = m r m l = m l m print(r) print r def check (m):
    now=0
    for i in range(N):
        now += (Ws[i] - 1) // m
    return now <= K def check (m):
    now=0
    for i in range(N):
        now += (Ws[i] - 1) // m
    return now <= K check N,K=list(map(int, input().split())) list(map(int, input().split())) N Ws=list(map(int, input().split())) list(map(int, input().split())) Ws r = m m r m = ( l + r ) // 2 ( l + r ) // 2 m l = m m l K=list(map(int, input().split())) list(map(int, input().split())) K r=10**9 10**9 r l=0 0 l
import sys , math

N,K=list(map(int, input().split()))
Ws=list(map(int, input().split()))
Ws.sort(reverse=True)

l=0
r=10**9

def check (m):
    now=0
    for i in range(N):
        now += (Ws[i] - 1) // m
    return now <= K

while r - l > 1:
    m = ( l + r ) // 2

    if check(m):
        r = m
    else:
        l = m
print(r) 