import math

n,k = list(map(int,input().split()))

a = list(map(int,input().split()))



if k == 0:

	print((max(a)))

	exit()



suki = 1000000000

kirai = 0

while int(suki) != int(kirai):

	targ = (suki+kirai)/2

	cnt = 0

	mode = 1

	for i in range(n):

		cnt += (a[i]-1)//targ

		if cnt > k:

			mode = 0

			break

	if mode:

		suki = targ

	else:

		kirai = targ



print((math.ceil(suki)))
import math

n,k = list(map(int,input().split()))

a = list(map(int,input().split()))



if k == 0:

	print((max(a)))

	exit()



suki = 1000000000

kirai = 0

while suki-kirai>1:

	targ = (suki+kirai)//2

	cnt = 0

	mode = 1

	for i in range(n):

		cnt += -(-a[i]//targ)-1

		if cnt > k:

			mode = 0

			break

	if mode:

		suki = targ

	else:

		kirai = targ



print((math.ceil(suki)))
import math

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
if k == 0:
    print((max(a)))
    exit()
suki = 1000000000
kirai = 0
while int(suki) != int(kirai):
    targ = (suki + kirai) / 2
    cnt = 0
    mode = 1
    for i in range(n):
        cnt += (a[i] - 1) // targ
        if cnt > k:
            mode = 0
            break
    if mode:
        suki = targ
    else:
        kirai = targ
print((math.ceil(suki)))

import math

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
if k == 0:
    print((max(a)))
    exit()
suki = 1000000000
kirai = 0
while suki - kirai > 1:
    targ = (suki + kirai) // 2
    cnt = 0
    mode = 1
    for i in range(n):
        cnt += -(-a[i] // targ) - 1
        if cnt > k:
            mode = 0
            break
    if mode:
        suki = targ
    else:
        kirai = targ
print((math.ceil(suki)))

-while int(suki) != int(kirai): -    targ = (suki + kirai) / 2 +while suki - kirai > 1: +    targ = (suki + kirai) // 2 -        cnt += (a[i] - 1) // targ +        cnt += -(-a[i] // targ) - 1