from math import ceil

def check(arr,n,k,w):
    res=0
    for i in range(n):
        res+=ceil(arr[i]/w)-1
    if res<=k:
        return 1
    return 0
    
n,k=map(int,input().split())
arr=list(map(int,input().split()))

minn=1
maxx=max(arr)
while(1):
    val=ceil((minn+maxx)/2)
    if maxx==val:
        if check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))):
            print(val)
            break
        else:
            print(val-1)
            break
    if check(arr,n,k,val):
        maxx=val
    else:
        minn=val
    





  from math import ceil def check(arr,n,k,w):
    res=0
    for i in range(n):
        res+=ceil(arr[i]/w)-1
    if res<=k:
        return 1
    return 0
     check res=0 res 0 for i in range(n):
        res+=ceil(arr[i]/w)-1
     i range(n) range n res+=ceil(arr[i]/w)-1 res ceil(arr[i]/w)-1 ceil(arr[i]/w) ceil arr[i]/w arr[i] arr i w 1 if res<=k:
        return 1
     res<=k res k return 1 1 return 0 0 arr arr n n k k w w n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k arr=list(map(int,input().split())) arr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split minn=1 minn 1 maxx=max(arr) maxx max(arr) max arr while(1):
    val=ceil((minn+maxx)/2)
    if maxx==val:
        if check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))):
            print(val)
            break
        else:
            print(val-1)
            break
    if check(arr,n,k,val):
        maxx=val
    else:
        minn=val
    





  1 val=ceil((minn+maxx)/2) val ceil((minn+maxx)/2) ceil (minn+maxx)/2 minn+maxx minn maxx 2 if maxx==val:
        if check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))):
            print(val)
            break
        else:
            print(val-1)
            break
     maxx==val maxx val if check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))):
            print(val)
            break
        else:
            print(val-1)
            break
     check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))) check(arr,n,k,val) check arr n k val val==1 or not(check(arr,n,k,val-1)) val==1 val 1 not(check(arr,n,k,val-1)) check(arr,n,k,val-1) check arr n k val-1 val 1 print(val) print val break print(val-1) print val-1 val 1 break if check(arr,n,k,val):
        maxx=val
    else:
        minn=val
    





  check(arr,n,k,val) check arr n k val maxx=val maxx val minn=val minn val k=map(int,input().split()) map(int,input().split()) k arr=list(map(int,input().split())) list(map(int,input().split())) arr val=ceil((minn+maxx)/2) ceil((minn+maxx)/2) val maxx=val val maxx minn=val val minn def check(arr,n,k,w):
    res=0
    for i in range(n):
        res+=ceil(arr[i]/w)-1
    if res<=k:
        return 1
    return 0
     def check(arr,n,k,w):
    res=0
    for i in range(n):
        res+=ceil(arr[i]/w)-1
    if res<=k:
        return 1
    return 0
     check n,k=map(int,input().split()) map(int,input().split()) n minn=1 1 minn maxx=max(arr) max(arr) maxx
from math import ceil

def check(arr,n,k,w):
    res=0
    for i in range(n):
        res+=ceil(arr[i]/w)-1
    if res<=k:
        return 1
    return 0
    
n,k=map(int,input().split())
arr=list(map(int,input().split()))

minn=1
maxx=max(arr)
while(1):
    val=ceil((minn+maxx)/2)
    if maxx==val:
        if check(arr,n,k,val) and (val==1 or not(check(arr,n,k,val-1))):
            print(val)
            break
        else:
            print(val-1)
            break
    if check(arr,n,k,val):
        maxx=val
    else:
        minn=val
    





 