from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,k = readInts()
a = readInts()

a.sort(reverse=True)

if n==1:
	print(math.ceil(a[0]/(k+1)))
	exit()

def get(left, right):
	l = (right-left)//2+left
	ans = 0
	for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	return ans,l

def nibu(left,right):
	ans,l = get(left, right)

	if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right


print(nibu(1,a[0])) from collections import defaultdict from collections import deque from collections import Counter import math math def readInt():
	return int(input()) readInt return int(input()) int(input()) int input() input def readInts():
	return list(map(int, input().split())) readInts return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def readChar():
	return input() readChar return input() input() input def readChars():
	return input().split() readChars return input().split() input().split() ().split () input split n,k = readInts() n readInts() readInts k a = readInts() a readInts() readInts a.sort(reverse=True) a.sort a sort reverse=True reverse True if n==1:
	print(math.ceil(a[0]/(k+1)))
	exit() n==1 n 1 print(math.ceil(a[0]/(k+1))) print math.ceil(a[0]/(k+1)) math.ceil math ceil a[0]/(k+1) a[0] a 0 k+1 k 1 exit() exit def get(left, right):
	l = (right-left)//2+left
	ans = 0
	for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	return ans,l get l = (right-left)//2+left l (right-left)//2+left (right-left)//2 right-left right left 2 left ans = 0 ans 0 for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	 i a ans+=math.ceil(i/l)-1 ans math.ceil(i/l)-1 math.ceil(i/l) math.ceil math ceil i/l i l 1 return ans,l return ans,l ans l left left right right def nibu(left,right):
	ans,l = get(left, right)

	if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right nibu ans,l = get(left, right) ans get(left, right) get left right l if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right left<right left right if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	 ans<=k ans k return nibu(left,l) nibu(left,l) nibu left l return nibu(l+1, right) nibu(l+1, right) nibu l+1 l 1 right return right right left left right right print(nibu(1,a[0])) print nibu(1,a[0]) nibu 1 a[0] a 0 def readInts():
	return list(map(int, input().split())) def readInts():
	return list(map(int, input().split())) readInts def get(left, right):
	l = (right-left)//2+left
	ans = 0
	for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	return ans,l def get(left, right):
	l = (right-left)//2+left
	ans = 0
	for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	return ans,l get a = readInts() readInts() a k = readInts() readInts() k def readChar():
	return input() def readChar():
	return input() readChar n,k = readInts() readInts() n def readInt():
	return int(input()) def readInt():
	return int(input()) readInt def nibu(left,right):
	ans,l = get(left, right)

	if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right def nibu(left,right):
	ans,l = get(left, right)

	if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right nibu def readChars():
	return input().split() def readChars():
	return input().split() readChars
from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,k = readInts()
a = readInts()

a.sort(reverse=True)

if n==1:
	print(math.ceil(a[0]/(k+1)))
	exit()

def get(left, right):
	l = (right-left)//2+left
	ans = 0
	for i in a:
		ans+=math.ceil(i/l)-1
	#print(l, ans, left, right)
	return ans,l

def nibu(left,right):
	ans,l = get(left, right)

	if left<right:
		if ans<=k:
			return nibu(left,l)
		else:
			return nibu(l+1, right)
	else:
		return right


print(nibu(1,a[0]))
