from math import *



def trycut(val):

	ret = 0

	for i in range(n):

		ret += ceil(a[i]/val)-1

	return ret 



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

a = [int(i) for i in input().split()]



low = 0

high = 1000000000

ans  =-1



while low <= high:

	mid = (low + high)/2

	cut = trycut(mid)

	# ~ print("low=",low, "high=", high,"val = ",mid,"ret = ",cut)

	if cut <= k:

		high = mid-0.0000001

		ans = mid

	else:

		low =  mid+0.0000001

	# ~ if low < high: print(low, high, "je reviens")

ans = int(ans*1000000)/1000000

# ~ print(ans)

print((int(ceil(ans))))





from math import *



def trycut(val):

	if val == 0 : return float('inf')

	ret = 0

	for i in range(n):

		ret += ceil(a[i]/val)-1

	return ret 



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

a = [int(i) for i in input().split()]



low = 0

high = 1000000000

ans  =-1



while low <= high:

	mid = (low + high)//2

	cut = trycut(mid)

	if cut <= k:

		high = mid-1

		ans = mid

	else:

		low =  mid+1

print(ans)





from math import *


def trycut(val):
    ret = 0
    for i in range(n):
        ret += ceil(a[i] / val) - 1
    return ret


n, k = list(map(int, input().split()))
a = [int(i) for i in input().split()]
low = 0
high = 1000000000
ans = -1
while low <= high:
    mid = (low + high) / 2
    cut = trycut(mid)
    # ~ print("low=",low, "high=", high,"val = ",mid,"ret = ",cut)
    if cut <= k:
        high = mid - 0.0000001
        ans = mid
    else:
        low = mid + 0.0000001
    # ~ if low < high: print(low, high, "je reviens")
ans = int(ans * 1000000) / 1000000
# ~ print(ans)
print((int(ceil(ans))))

from math import *


def trycut(val):
    if val == 0:
        return float("inf")
    ret = 0
    for i in range(n):
        ret += ceil(a[i] / val) - 1
    return ret


n, k = list(map(int, input().split()))
a = [int(i) for i in input().split()]
low = 0
high = 1000000000
ans = -1
while low <= high:
    mid = (low + high) // 2
    cut = trycut(mid)
    if cut <= k:
        high = mid - 1
        ans = mid
    else:
        low = mid + 1
print(ans)

+    if val == 0: +        return float("inf") -    mid = (low + high) / 2 +    mid = (low + high) // 2 -    # ~ print("low=",low, "high=", high,"val = ",mid,"ret = ",cut) -        high = mid - 0.0000001 +        high = mid - 1 -        low = mid + 0.0000001 -    # ~ if low < high: print(low, high, "je reviens") -ans = int(ans * 1000000) / 1000000 -# ~ print(ans) -print((int(ceil(ans)))) +        low = mid + 1 +print(ans)