import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
def chk(mid,a,n,k):
    cuts=0
    for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
    return (True if cuts<=k else False)

n,k = rm()
a = rl()
lo = 1
hi = 10**9
ans = 10**9
while lo < hi :
    mid = (lo+hi)//2
    if chk(mid,a,n,k):
        hi=mid
        ans=mid
    else:
        lo = mid+1
print(ans) import os os import sys sys import math math import heapq heapq from decimal import * from io import BytesIO, IOBase from collections import defaultdict, deque def r():
    return int(input()) r return int(input()) int(input()) int input() input def rm():
    return map(int,input().split()) rm return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def rl():
    return list(map(int,input().split())) rl return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def chk(mid,a,n,k):
    cuts=0
    for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
    return (True if cuts<=k else False) chk cuts=0 cuts 0 for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
     i a if i <= mid:
            continue
         i <= mid i mid continue cuts += i//mid+(-1 if i%mid==0 else 0) cuts i//mid+(-1 if i%mid==0 else 0) i//mid i mid -1 if i%mid==0 else 0 i%mid==0 i%mid i mid 0 -1 0 return (True if cuts<=k else False) True if cuts<=k else False cuts<=k cuts k True False mid mid a a n n k k n,k = rm() n rm() rm k a = rl() a rl() rl lo = 1 lo 1 hi = 10**9 hi 10**9 10 9 ans = 10**9 ans 10**9 10 9 while lo < hi :
    mid = (lo+hi)//2
    if chk(mid,a,n,k):
        hi=mid
        ans=mid
    else:
        lo = mid+1 lo < hi lo hi mid = (lo+hi)//2 mid (lo+hi)//2 lo+hi lo hi 2 if chk(mid,a,n,k):
        hi=mid
        ans=mid
    else:
        lo = mid+1 chk(mid,a,n,k) chk mid a n k hi=mid hi mid ans=mid ans mid lo = mid+1 lo mid+1 mid 1 print(ans) print ans ans = 10**9 10**9 ans ans=mid mid ans def rl():
    return list(map(int,input().split())) def rl():
    return list(map(int,input().split())) rl a = rl() rl() a lo = 1 1 lo lo = mid+1 mid+1 lo def rm():
    return map(int,input().split()) def rm():
    return map(int,input().split()) rm mid = (lo+hi)//2 (lo+hi)//2 mid def r():
    return int(input()) def r():
    return int(input()) r hi=mid mid hi k = rm() rm() k def chk(mid,a,n,k):
    cuts=0
    for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
    return (True if cuts<=k else False) def chk(mid,a,n,k):
    cuts=0
    for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
    return (True if cuts<=k else False) chk hi = 10**9 10**9 hi n,k = rm() rm() n
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))
def chk(mid,a,n,k):
    cuts=0
    for i in a:
        if i <= mid:
            continue
        cuts += i//mid+(-1 if i%mid==0 else 0)
    return (True if cuts<=k else False)

n,k = rm()
a = rl()
lo = 1
hi = 10**9
ans = 10**9
while lo < hi :
    mid = (lo+hi)//2
    if chk(mid,a,n,k):
        hi=mid
        ans=mid
    else:
        lo = mid+1
print(ans)