import math

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

a = list(map(int, input().split()))
l = 0
r = max(a)

x = (l+r)//2
ans = r+1
while(r>1+l):

    
    x = (l+r)//2
    if x == 0:
        break

    count = 0
    for i in range(N):
        count += math.ceil(a[i] /x)-1
    if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x
count = 0
ans = x
if(x!= 0 and l != 0):
        
    for i in range(N):
        count += math.ceil(a[i]/l)-1

    if (count <=K):
        ans = l
    else:
        ans = r

if l==0:
    ans = r
print(ans)

        
        

     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 l = 0 l 0 r = max(a) r max(a) max a x = (l+r)//2 x (l+r)//2 l+r l r 2 ans = r+1 ans r+1 r 1 while(r>1+l):

    
    x = (l+r)//2
    if x == 0:
        break

    count = 0
    for i in range(N):
        count += math.ceil(a[i] /x)-1
    if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x r>1+l r 1+l 1 l x = (l+r)//2 x (l+r)//2 l+r l r 2 if x == 0:
        break

     x == 0 x 0 break count = 0 count 0 for i in range(N):
        count += math.ceil(a[i] /x)-1
     i range(N) range N count += math.ceil(a[i] /x)-1 count math.ceil(a[i] /x)-1 math.ceil(a[i] /x) math.ceil math ceil a[i] /x a[i] a i x 1 if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x count <=K count K if (ans > x):
            ans = x
         ans > x ans x ans = x ans x r = x r x l = x l x count = 0 count 0 ans = x ans x if(x!= 0 and l != 0):
        
    for i in range(N):
        count += math.ceil(a[i]/l)-1

    if (count <=K):
        ans = l
    else:
        ans = r x!= 0 and l != 0 x!= 0 x 0 l != 0 l 0 for i in range(N):
        count += math.ceil(a[i]/l)-1

     i range(N) range N count += math.ceil(a[i]/l)-1 count math.ceil(a[i]/l)-1 math.ceil(a[i]/l) math.ceil math ceil a[i]/l a[i] a i l 1 if (count <=K):
        ans = l
    else:
        ans = r count <=K count K ans = l ans l ans = r ans r if l==0:
    ans = r l==0 l 0 ans = r ans r print(ans) print ans K = map(int,input().split()) map(int,input().split()) K ans = l l ans a = list(map(int, input().split())) list(map(int, input().split())) a x = (l+r)//2 (l+r)//2 x x = (l+r)//2 (l+r)//2 x r = x x r ans = r r ans count += math.ceil(a[i] /x)-1 math.ceil(a[i] /x)-1 count ans = r+1 r+1 ans ans = x x ans count = 0 0 count ans = r r ans N,K = map(int,input().split()) map(int,input().split()) N ans = x x ans count = 0 0 count l = 0 0 l l = x x l count += math.ceil(a[i]/l)-1 math.ceil(a[i]/l)-1 count r = max(a) max(a) r
import math

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

a = list(map(int, input().split()))
l = 0
r = max(a)

x = (l+r)//2
ans = r+1
while(r>1+l):

    
    x = (l+r)//2
    if x == 0:
        break

    count = 0
    for i in range(N):
        count += math.ceil(a[i] /x)-1
    if (count <=K):
        if (ans > x):
            ans = x
        r = x
    else:
        l = x
count = 0
ans = x
if(x!= 0 and l != 0):
        
    for i in range(N):
        count += math.ceil(a[i]/l)-1

    if (count <=K):
        ans = l
    else:
        ans = r

if l==0:
    ans = r
print(ans)

        
        

    
