#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  n, k = map(int, input().strip().split())
  la = list(map(int, input().strip().split()))
  la.sort()
  
  def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
  def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
  s, t = 0, 10 ** 9
  print(bs(s, t))
  
if __name__=='__main__':
  main()
 from math import ceil def main():
  n, k = map(int, input().strip().split())
  la = list(map(int, input().strip().split()))
  la.sort()
  
  def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
  def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
  s, t = 0, 10 ** 9
  print(bs(s, t))
   main n, k = map(int, input().strip().split()) n map(int, input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split k la = list(map(int, input().strip().split())) la list(map(int, input().strip().split())) list map(int, input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split la.sort() la.sort la sort def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
   check cnt = 0 cnt 0 for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
     a la cnt += ceil(a / x) - 1 cnt ceil(a / x) - 1 ceil(a / x) ceil a / x a x 1 if cnt > k:
        return False
     cnt > k cnt k return False False return True True x x def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
   bs while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
     ceil(s) != ceil(t) ceil(s) ceil s ceil(t) ceil t x = (s + t) / 2 x (s + t) / 2 s + t s t 2 if check(x):
        t = x
      else:
        s = x
     check(x) check x t = x t x s = x s x return ceil(x) ceil(x) ceil x s s t t s, t = 0, 10 ** 9 s 0 t 10 ** 9 10 9 print(bs(s, t)) print bs(s, t) bs s t if __name__=='__main__':
  main() __name__=='__main__' __name__ '__main__' main() main def main():
  n, k = map(int, input().strip().split())
  la = list(map(int, input().strip().split()))
  la.sort()
  
  def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
  def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
  s, t = 0, 10 ** 9
  print(bs(s, t))
   def main():
  n, k = map(int, input().strip().split())
  la = list(map(int, input().strip().split()))
  la.sort()
  
  def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
  def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
  s, t = 0, 10 ** 9
  print(bs(s, t))
   main
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from math import ceil

def main():
  n, k = map(int, input().strip().split())
  la = list(map(int, input().strip().split()))
  la.sort()
  
  def check(x):
    cnt = 0
    for a in la:
      cnt += ceil(a / x) - 1
      if cnt > k:
        return False
    return True
 
  def bs(s, t):
    while ceil(s) != ceil(t):
      x = (s + t) / 2
      if check(x):
        t = x
      else:
        s = x
    return ceil(x)
  
  s, t = 0, 10 ** 9
  print(bs(s, t))
  
if __name__=='__main__':
  main()

