output_description: Print an integer representing the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      A_1 A_2 \cdots A_N
attempt: # 2020年6月17日
  
  # 修行という概念がない場合、消化コストを大から小に並べて食べにくさを小から大に並べて順にマッチングさせれば良い。
  # そうでない状態から2つを交換したときに最大値が下がる方向にしか行かないため。
  
  # 修行をするなら最大値を引き下げるところに修行をするのが最適なので、
  # 無修行状態の結果を優先度付きキューに入れる→K回最大値を取り出してコストを引いて再投入→を繰り返す。
  # 本当か? やってるうちに最適な組み合わせが変わらないか? →変わらない。食べにくさを昇順に並べたときに消化コストが降順になるのが最善手なので。
  # あとKが大きいのでこれだと間に合わない。
  
  # 決め打ち二分探索か?
  # あ、それだわ。
  
  # Python TLE 2秒以上
  # PyPy 287ms
  
  n, k = list(map(int, input().split()))
  
  lengths = list(map(int, input().split()))
  
  
  def is_valid(unit):
      # k回以下の切断で実現可能か
  
      n_cut = sum(map(lambda p: (p + unit - 1) // unit - 1, lengths))
      # print(unit, n_cut)
  
      return n_cut <= k
  
  
  unit_ok = 10**9 + 1
  unit_ng = 0
  
  # めぐる式二分探索
  while abs(unit_ok - unit_ng) > 1:
      mid = (unit_ok + unit_ng) // 2
      if is_valid(mid):
          unit_ok = mid
      else:
          unit_ng = mid
  
  print(unit_ok)
  
problem_description: Statement
  
  We have N logs of lengths A_1,A_2,\cdots A_N.
  
  We can cut these logs at most K times in total. When a log of length L is cut
  at a point whose distance from an end of the log is t (0<t<L), it becomes two
  logs of lengths t and L-t.
  
  Find the shortest possible length of the longest log after at most K cuts, and
  print it after rounding up to an integer.
samples: [{"input": "2 3\n    7 9", "output": "4\n    \n\n  * First, we will cut the log of length 7 at a point whose distance from an end of the log is 3.5, resulting in two logs of length 3.5 each.\n  * Next, we will cut the log of length 9 at a point whose distance from an end of the log is 3, resulting in two logs of length 3 and 6.\n  * Lastly, we will cut the log of length 6 at a point whose distance from an end of the log is 3.3, resulting in two logs of length 3.3 and 2.7.\n\nIn this case, the longest length of a log will be 3.5, which is the shortest\npossible result. After rounding up to an integer, the output should be 4.\n\n* * *"}, {"input": "3 0\n    3 4 5", "output": "5\n    \n\n* * *"}, {"input": "10 10\n    158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202", "output": "292638192"}]