import copy
import math

def judge(As,K,C):
    count = 0
    for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
    if count <= K:
        return True
    else:
        return False

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

l = 0
r = max(As)
while(r-l>1):
    mid = (l+r)//2
    if judge(As,K,mid):
        r = mid
    else:
        l = mid
print(r) import copy copy import math math def judge(As,K,C):
    count = 0
    for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
    if count <= K:
        return True
    else:
        return False judge count = 0 count 0 for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
     i range(len(As)) range len(As) len As if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
         As[i]%C == 0 As[i]%C As[i] As i C 0 m = As[i]//C - 1 m As[i]//C - 1 As[i]//C As[i] As i C 1 m = As[i]//C m As[i]//C As[i] As i C count += m count m if count <= K:
        return True
    else:
        return False count <= K count K return True True return False False As As K K C C 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 As = list(map(int,input().split())) As list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split l = 0 l 0 r = max(As) r max(As) max As while(r-l>1):
    mid = (l+r)//2
    if judge(As,K,mid):
        r = mid
    else:
        l = mid r-l>1 r-l r l 1 mid = (l+r)//2 mid (l+r)//2 l+r l r 2 if judge(As,K,mid):
        r = mid
    else:
        l = mid judge(As,K,mid) judge As K mid r = mid r mid l = mid l mid print(r) print r K = list(map(int,input().split())) list(map(int,input().split())) K mid = (l+r)//2 (l+r)//2 mid As = list(map(int,input().split())) list(map(int,input().split())) As l = 0 0 l l = mid mid l r = max(As) max(As) r N, K = list(map(int,input().split())) list(map(int,input().split())) N r = mid mid r def judge(As,K,C):
    count = 0
    for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
    if count <= K:
        return True
    else:
        return False def judge(As,K,C):
    count = 0
    for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
    if count <= K:
        return True
    else:
        return False judge
import copy
import math

def judge(As,K,C):
    count = 0
    for i in range(len(As)):
        if As[i]%C == 0:
            m = As[i]//C - 1
        else:
            m = As[i]//C
        count += m
    if count <= K:
        return True
    else:
        return False

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

l = 0
r = max(As)
while(r-l>1):
    mid = (l+r)//2
    if judge(As,K,mid):
        r = mid
    else:
        l = mid
print(r)