"""ABC174E diff: 1158
"""

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

if K == 0:
    print(max(A))
    exit()

def f(x):
    """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
    if cnt <= K:
        return True
    else:
        return False

left = 0
right = max(A) + 10

while right - left > 1:
    mid = (left+right) // 2
    if f(mid):
        right = mid
    else:
        left = mid
print(right) """ABC174E diff: 1158
""" 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 if K == 0:
    print(max(A))
    exit() K == 0 K 0 print(max(A)) print max(A) max A exit() exit def f(x):
    """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
    if cnt <= K:
        return True
    else:
        return False f """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """ cnt = 0 cnt 0 for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
     a A if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
     a % x == 0 a % x a x 0 cnt += a//x - 1 cnt a//x - 1 a//x a x 1 cnt += a//x cnt a//x a x if cnt <= K:
        return True
    else:
        return False cnt <= K cnt K return True True return False False x x left = 0 left 0 right = max(A) + 10 right max(A) + 10 max(A) max A 10 while right - left > 1:
    mid = (left+right) // 2
    if f(mid):
        right = mid
    else:
        left = mid right - left > 1 right - left right left 1 mid = (left+right) // 2 mid (left+right) // 2 left+right left right 2 if f(mid):
        right = mid
    else:
        left = mid f(mid) f mid right = mid right mid left = mid left mid print(right) print right mid = (left+right) // 2 (left+right) // 2 mid right = mid mid right def f(x):
    """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
    if cnt <= K:
        return True
    else:
        return False def f(x):
    """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
    if cnt <= K:
        return True
    else:
        return False f K=map(int,input().split()) map(int,input().split()) K left = 0 0 left left = mid mid left N,K=map(int,input().split()) map(int,input().split()) N A=list(map(int, input().split())) list(map(int, input().split())) A right = max(A) + 10 max(A) + 10 right
"""ABC174E diff: 1158
"""

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

if K == 0:
    print(max(A))
    exit()

def f(x):
    """
    K回以内のカットで全ての丸太の長さをX以下にできるか？
    X: int
    Return: bool
    """
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x - 1
        else:
            cnt += a//x
    
    if cnt <= K:
        return True
    else:
        return False

left = 0
right = max(A) + 10

while right - left > 1:
    mid = (left+right) // 2
    if f(mid):
        right = mid
    else:
        left = mid
print(right)