import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**9

def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
    return cnt <= k

if __name__ == "__main__":
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    left = 0
    right = max(a)
    #最大値の最小値は二分探索
    while right - left > 1:
        mid = (right+left)//2
        if ok(mid):
            right = mid
        else:
            left = mid
    print(right) import sys sys import itertools itertools sys.setrecursionlimit(1000000000) sys.setrecursionlimit sys setrecursionlimit 1000000000 from heapq import heapify,heappop,heappush,heappushpop import math math import collections collections import copy copy INF = 10**9 INF 10**9 10 9 def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
    return cnt <= k ok cnt = 0 cnt 0 for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
     L a cnt += L//l cnt L//l L l if L%l != 0:
            cnt+=1
         L%l != 0 L%l L l 0 cnt+=1 cnt 1 cnt-=1 cnt 1 return cnt <= k cnt <= k cnt k l l if __name__ == "__main__":
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    left = 0
    right = max(a)
    #最大値の最小値は二分探索
    while right - left > 1:
        mid = (right+left)//2
        if ok(mid):
            right = mid
        else:
            left = mid
    print(right) __name__ == "__main__" __name__ "__main__" 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 left = 0 left 0 right = max(a) right max(a) max a while right - left > 1:
        mid = (right+left)//2
        if ok(mid):
            right = mid
        else:
            left = mid
     right - left > 1 right - left right left 1 mid = (right+left)//2 mid (right+left)//2 right+left right left 2 if ok(mid):
            right = mid
        else:
            left = mid
     ok(mid) ok mid right = mid right mid left = mid left mid print(right) print right left = 0 0 left left = mid mid left mid = (right+left)//2 (right+left)//2 mid n,k = map(int,input().split()) map(int,input().split()) n right = max(a) max(a) right a = list(map(int,input().split())) list(map(int,input().split())) a right = mid mid right def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
    return cnt <= k def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
    return cnt <= k ok INF = 10**9 10**9 INF k = map(int,input().split()) map(int,input().split()) k
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**9

def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt+=1
        cnt-=1
    return cnt <= k

if __name__ == "__main__":
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    left = 0
    right = max(a)
    #最大値の最小値は二分探索
    while right - left > 1:
        mid = (right+left)//2
        if ok(mid):
            right = mid
        else:
            left = mid
    print(right)