###2分探索

import sys

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

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

p = 0###無理（そこまで小さくできない）
q = max(A)###可能

if K == 0:
    print(q)
    sys.exit(0)

while q-p > 1:
    r = (p+q)//2
    count = 0
    for i in range(N):
        if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
    if count > K:
        p = r
    else:
        q = r
    #print(p,q)

print(q) import sys sys 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 p = 0 p 0 q = max(A) q max(A) max A if K == 0:
    print(q)
    sys.exit(0) K == 0 K 0 print(q) print q sys.exit(0) sys.exit sys exit 0 while q-p > 1:
    r = (p+q)//2
    count = 0
    for i in range(N):
        if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
    if count > K:
        p = r
    else:
        q = r
    #print(p,q) q-p > 1 q-p q p 1 r = (p+q)//2 r (p+q)//2 p+q p q 2 count = 0 count 0 for i in range(N):
        if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
     i range(N) range N if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
     A[i]/r == A[i]//r A[i]/r A[i] A i r A[i]//r A[i] A i r count += A[i]//r - 1 count A[i]//r - 1 A[i]//r A[i] A i r 1 count += A[i]//r count A[i]//r A[i] A i r if count > K:
        p = r
    else:
        q = r
    #print(p,q) count > K count K p = r p r q = r q r print(q) print q N,K = map(int,input().split()) map(int,input().split()) N A = list(map(int,input().split())) list(map(int,input().split())) A count = 0 0 count r = (p+q)//2 (p+q)//2 r count += A[i]//r A[i]//r count q = r r q count += A[i]//r - 1 A[i]//r - 1 count K = map(int,input().split()) map(int,input().split()) K p = r r p q = max(A) max(A) q p = 0 0 p
###2分探索

import sys

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

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

p = 0###無理（そこまで小さくできない）
q = max(A)###可能

if K == 0:
    print(q)
    sys.exit(0)

while q-p > 1:
    r = (p+q)//2
    count = 0
    for i in range(N):
        if A[i]/r == A[i]//r:
            count += A[i]//r - 1
        else:
            count += A[i]//r
    if count > K:
        p = r
    else:
        q = r
    #print(p,q)

print(q)