# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)
# 切り上げ割り算
# -(-4 // 3)
# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()
max_a = max(A)
rest = K
# 答えはX以下か？を考える
# 長さaの丸太を切ってX以下にするためには、
# -(-a//X)回切る必要がある


def trial(x):
    # print('try', x)
    num_cut = 0
    for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
    return True


# 答えの範囲は0~max(A)
l = 0
r = max_a
while (r - l > 1):
    ans = (l + r) // 2
    if (trial(ans)):
        # print(ans)
        r = ans
    else:
        l = ans
print(r) import numpy as np numpy import sys sys from collections import deque from collections import defaultdict import heapq heapq import collections collections import itertools itertools import bisect bisect from scipy.special import comb import copy copy sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 def zz():
    return list(map(int, sys.stdin.readline().split())) zz return list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def z():
    return int(sys.stdin.readline()) z return int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def S():
    return sys.stdin.readline()[:-1] S return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 def C(line):
    return [sys.stdin.readline() for _ in range(line)] C sys.stdin.readline() for _ in range(line) for _ in range(line) _ range(line) range line for _ in range(line) sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline return [sys.stdin.readline() for _ in range(line)] [sys.stdin.readline() for _ in range(line)] line line N, K = zz() N zz() zz K A = zz() A zz() zz max_a = max(A) max_a max(A) max A rest = K rest K def trial(x):
    # print('try', x)
    num_cut = 0
    for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
    return True


# 答えの範囲は0~max(A) trial num_cut = 0 num_cut 0 for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
     a A num_cut += (-(-a//x)-1) num_cut -(-a//x)-1 -(-a//x) -a//x -a a x 1 if (num_cut > K):
            return False
     num_cut > K num_cut K return False False return True True x x l = 0 l 0 r = max_a r max_a while (r - l > 1):
    ans = (l + r) // 2
    if (trial(ans)):
        # print(ans)
        r = ans
    else:
        l = ans r - l > 1 r - l r l 1 ans = (l + r) // 2 ans (l + r) // 2 l + r l r 2 if (trial(ans)):
        # print(ans)
        r = ans
    else:
        l = ans trial(ans) trial ans r = ans r ans l = ans l ans print(r) print r def C(line):
    return [sys.stdin.readline() for _ in range(line)] def C(line):
    return [sys.stdin.readline() for _ in range(line)] C N, K = zz() zz() N A = zz() zz() A max_a = max(A) max(A) max_a ans = (l + r) // 2 (l + r) // 2 ans K = zz() zz() K r = max_a max_a r def S():
    return sys.stdin.readline()[:-1] def S():
    return sys.stdin.readline()[:-1] S r = ans ans r def trial(x):
    # print('try', x)
    num_cut = 0
    for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
    return True


# 答えの範囲は0~max(A) def trial(x):
    # print('try', x)
    num_cut = 0
    for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
    return True


# 答えの範囲は0~max(A) trial rest = K K rest l = ans ans l def z():
    return int(sys.stdin.readline()) def z():
    return int(sys.stdin.readline()) z def zz():
    return list(map(int, sys.stdin.readline().split())) def zz():
    return list(map(int, sys.stdin.readline().split())) zz l = 0 0 l
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)
# 切り上げ割り算
# -(-4 // 3)
# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


N, K = zz()
A = zz()
max_a = max(A)
rest = K
# 答えはX以下か？を考える
# 長さaの丸太を切ってX以下にするためには、
# -(-a//X)回切る必要がある


def trial(x):
    # print('try', x)
    num_cut = 0
    for a in A:
        num_cut += (-(-a//x)-1)
        # print('num_cut', num_cut)
        if (num_cut > K):
            return False
    return True


# 答えの範囲は0~max(A)
l = 0
r = max_a
while (r - l > 1):
    ans = (l + r) // 2
    if (trial(ans)):
        # print(ans)
        r = ans
    else:
        l = ans
print(r)
