from math import *

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

n,k=map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = max(a)
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):
	if val == 0 : return float('inf')
	ret = 0
	for i in range(n):
		ret += (a[i]+val-1)//val -1
	return ret  trycut if val == 0 : return float('inf')
	 val == 0 val 0 ret = 0 ret 0 for i in range(n):
		ret += (a[i]+val-1)//val -1
	 i range(n) range n ret += (a[i]+val-1)//val -1 ret (a[i]+val-1)//val -1 (a[i]+val-1)//val a[i]+val-1 a[i]+val a[i] a i val 1 val 1 return ret ret val val n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] low = 0 low 0 high = max(a) high max(a) max a ans  =-1 ans -1 while low <= high:
	mid = (low + high)//2
	cut = trycut(mid)
	if cut <= k:
		high = mid-1
		ans = mid
	else:
		low =  mid+1 low <= high low high mid = (low + high)//2 mid (low + high)//2 low + high low high 2 cut = trycut(mid) cut trycut(mid) trycut mid if cut <= k:
		high = mid-1
		ans = mid
	else:
		low =  mid+1 cut <= k cut k high = mid-1 high mid-1 mid 1 ans = mid ans mid low =  mid+1 low mid+1 mid 1 print(ans) print ans a = [int(i) for i in input().split()] [int(i) for i in input().split()] a high = mid-1 mid-1 high ans = mid mid ans k=map(int,input().split()) map(int,input().split()) k cut = trycut(mid) trycut(mid) cut high = max(a) max(a) high low =  mid+1 mid+1 low n,k=map(int,input().split()) map(int,input().split()) n ans  =-1 -1 ans mid = (low + high)//2 (low + high)//2 mid def trycut(val):
	if val == 0 : return float('inf')
	ret = 0
	for i in range(n):
		ret += (a[i]+val-1)//val -1
	return ret  def trycut(val):
	if val == 0 : return float('inf')
	ret = 0
	for i in range(n):
		ret += (a[i]+val-1)//val -1
	return ret  trycut low = 0 0 low
from math import *

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

n,k=map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = max(a)
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)


