import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))


ng = 0##ngは常に条件を満たさないように設定
ok = max(logs)##okは常に条件を満たすように設定
while abs(ok-ng)>1:##absをとることで問題ごとにokとngの大小を考えなくてよくなる
  times = 0
  mid = (ok+ng)//2
  for A in logs:
    times += math.ceil(A/mid)-1
    
    
  if times <= K:
    ok = mid##条件を満たすならokを寄せる 
  else:
    ng = mid##満たさないならngを寄せる
    
print(ok)##今回はokそのまま答えだけど普通は添え字 import math math N, K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K logs = list(map(int,input().split())) logs list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ng = 0 ng 0 ok = max(logs) ok max(logs) max logs while abs(ok-ng)>1:##absをとることで問題ごとにokとngの大小を考えなくてよくなる
  times = 0
  mid = (ok+ng)//2
  for A in logs:
    times += math.ceil(A/mid)-1
    
    
  if times <= K:
    ok = mid##条件を満たすならokを寄せる 
  else:
    ng = mid##満たさないならngを寄せる
     abs(ok-ng)>1 abs(ok-ng) abs ok-ng ok ng 1 times = 0 times 0 mid = (ok+ng)//2 mid (ok+ng)//2 ok+ng ok ng 2 for A in logs:
    times += math.ceil(A/mid)-1
    
    
   A logs times += math.ceil(A/mid)-1 times math.ceil(A/mid)-1 math.ceil(A/mid) math.ceil math ceil A/mid A mid 1 if times <= K:
    ok = mid##条件を満たすならokを寄せる 
  else:
    ng = mid##満たさないならngを寄せる
     times <= K times K ok = mid ok mid ng = mid ng mid print(ok) print ok logs = list(map(int,input().split())) list(map(int,input().split())) logs times = 0 0 times ok = max(logs) max(logs) ok ok = mid mid ok mid = (ok+ng)//2 (ok+ng)//2 mid K = map(int,input().split()) map(int,input().split()) K times += math.ceil(A/mid)-1 math.ceil(A/mid)-1 times ng = 0 0 ng N, K = map(int,input().split()) map(int,input().split()) N ng = mid mid ng
import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))


ng = 0##ngは常に条件を満たさないように設定
ok = max(logs)##okは常に条件を満たすように設定
while abs(ok-ng)>1:##absをとることで問題ごとにokとngの大小を考えなくてよくなる
  times = 0
  mid = (ok+ng)//2
  for A in logs:
    times += math.ceil(A/mid)-1
    
    
  if times <= K:
    ok = mid##条件を満たすならokを寄せる 
  else:
    ng = mid##満たさないならngを寄せる
    
print(ok)##今回はokそのまま答えだけど普通は添え字
