from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
mi = 0
ma = max(a)
m = ma//2
while ma-mi>1:
  temp = 0
  for i in range(n):
    temp += ceil(a[i]/m)-1 
    #if a[i]%m==0:
    #  temp-=1
  if temp<=k:
    ma=m
    m=(ma+mi)//2
  else:
    mi = m
    m=(ma+mi)//2
  #print("temp " + str(temp))
  #print("ma " + str(ma)+ " mi " + str(mi) + " m " + str(m))
#print(m)
print(m+1) from math import ceil n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split mi = 0 mi 0 ma = max(a) ma max(a) max a m = ma//2 m ma//2 ma 2 while ma-mi>1:
  temp = 0
  for i in range(n):
    temp += ceil(a[i]/m)-1 
    #if a[i]%m==0:
    #  temp-=1
  if temp<=k:
    ma=m
    m=(ma+mi)//2
  else:
    mi = m
    m=(ma+mi)//2
  #print("temp " + str(temp))
  #print("ma " + str(ma)+ " mi " + str(mi) + " m " + str(m))
#print(m) ma-mi>1 ma-mi ma mi 1 temp = 0 temp 0 for i in range(n):
    temp += ceil(a[i]/m)-1 
    #if a[i]%m==0:
    #  temp-=1
   i range(n) range n temp += ceil(a[i]/m)-1 temp ceil(a[i]/m)-1 ceil(a[i]/m) ceil a[i]/m a[i] a i m 1 if temp<=k:
    ma=m
    m=(ma+mi)//2
  else:
    mi = m
    m=(ma+mi)//2
  #print("temp " + str(temp))
  #print("ma " + str(ma)+ " mi " + str(mi) + " m " + str(m))
#print(m) temp<=k temp k ma=m ma m m=(ma+mi)//2 m (ma+mi)//2 ma+mi ma mi 2 mi = m mi m m=(ma+mi)//2 m (ma+mi)//2 ma+mi ma mi 2 print(m+1) print m+1 m 1 temp += ceil(a[i]/m)-1 ceil(a[i]/m)-1 temp ma=m m ma n, k = map(int, input().split()) map(int, input().split()) n k = map(int, input().split()) map(int, input().split()) k ma = max(a) max(a) ma m=(ma+mi)//2 (ma+mi)//2 m mi = 0 0 mi temp = 0 0 temp m=(ma+mi)//2 (ma+mi)//2 m a = list(map(int, input().split())) list(map(int, input().split())) a m = ma//2 ma//2 m mi = m m mi
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
mi = 0
ma = max(a)
m = ma//2
while ma-mi>1:
  temp = 0
  for i in range(n):
    temp += ceil(a[i]/m)-1 
    #if a[i]%m==0:
    #  temp-=1
  if temp<=k:
    ma=m
    m=(ma+mi)//2
  else:
    mi = m
    m=(ma+mi)//2
  #print("temp " + str(temp))
  #print("ma " + str(ma)+ " mi " + str(mi) + " m " + str(m))
#print(m)
print(m+1)