# region header
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
import copy
# @lru_cache(maxsize=None)
# sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
# endregion
# region input function


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])

# endregion


n, k = inpl()
a = inpl()

l = 0
r = 10**9
while l + 1 < r:
    x = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += math.ceil(a[i] / x) - 1
        if cnt > k:
            break
    if cnt <= k:
        r = x
    else:
        l = x
print(r) import sys, bisect, math, itertools, heapq, collections sys bisect math itertools heapq collections from operator import itemgetter from functools import lru_cache import copy copy input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline INF = float('inf') INF float('inf') float 'inf' mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 eps = 10**-7 eps 10**-7 10 -7 def inp():
    '''
    一つの整数
    '''
    return int(input()) inp '''
    一つの整数
    ''' return int(input()) int(input()) int input() input def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split())) inpl '''
    一行に複数の整数
    ''' return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])

# endregion str_inp '''
    文字列をリストとして読み込む
    ''' return list(input()[:-1]) list(input()[:-1]) list input()[:-1] () input :-1 -1 n, k = inpl() n inpl() inpl k a = inpl() a inpl() inpl l = 0 l 0 r = 10**9 r 10**9 10 9 while l + 1 < r:
    x = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += math.ceil(a[i] / x) - 1
        if cnt > k:
            break
    if cnt <= k:
        r = x
    else:
        l = x l + 1 < r l + 1 l 1 r x = (l + r) // 2 x (l + r) // 2 l + r l r 2 cnt = 0 cnt 0 for i in range(n):
        cnt += math.ceil(a[i] / x) - 1
        if cnt > k:
            break
     i range(n) range n cnt += math.ceil(a[i] / x) - 1 cnt math.ceil(a[i] / x) - 1 math.ceil(a[i] / x) math.ceil math ceil a[i] / x a[i] a i x 1 if cnt > k:
            break
     cnt > k cnt k break if cnt <= k:
        r = x
    else:
        l = x cnt <= k cnt k r = x r x l = x l x print(r) print r k = inpl() inpl() k x = (l + r) // 2 (l + r) // 2 x l = x x l def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])

# endregion def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])

# endregion str_inp eps = 10**-7 10**-7 eps n, k = inpl() inpl() n r = 10**9 10**9 r cnt += math.ceil(a[i] / x) - 1 math.ceil(a[i] / x) - 1 cnt INF = float('inf') float('inf') INF def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split())) def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split())) inpl def inp():
    '''
    一つの整数
    '''
    return int(input()) def inp():
    '''
    一つの整数
    '''
    return int(input()) inp l = 0 0 l mod = 10**9 + 7 10**9 + 7 mod cnt = 0 0 cnt a = inpl() inpl() a r = x x r input = sys.stdin.readline sys.stdin.readline input
# region header
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
import copy
# @lru_cache(maxsize=None)
# sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
# endregion
# region input function


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])

# endregion


n, k = inpl()
a = inpl()

l = 0
r = 10**9
while l + 1 < r:
    x = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += math.ceil(a[i] / x) - 1
        if cnt > k:
            break
    if cnt <= k:
        r = x
    else:
        l = x
print(r)
