#!/usr/bin/env python3

import os
import sys
import numpy as np

def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1)

def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item()


def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS)))

if __name__ == '__main__':
  main() import os os import sys sys import numpy as np numpy def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1) ncut return np.sum(np.ceil(l / x) - 1) np.sum(np.ceil(l / x) - 1) np.sum np sum np.ceil(l / x) - 1 np.ceil(l / x) np.ceil np ceil l / x l x 1 l l x x def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item() solve ng, ok = -1, np.amax(AS) ng -1 ok np.amax(AS) np.amax np amax AS while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

   abs(ok - ng) > 1 abs(ok - ng) abs ok - ng ok ng 1 mid = (ok + ng) // 2 mid (ok + ng) // 2 ok + ng ok ng 2 if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

   ncut(AS, mid) <= K ncut(AS, mid) ncut AS mid K ok = mid ok mid ng = mid ng mid return ok.item() ok.item() ok.item ok item N N K K AS AS def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS))) main d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ') d np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ') np.fromstring np fromstring sys.stdin.read() sys.stdin.read sys.stdin sys stdin read dtype=np.int64 dtype np.int64 np int64 sep=' ' sep ' ' N, K = d[:2] N d[:2] d :2 2 K AS = d[2:] AS d[2:] d 2: 2 print('{}'.format(solve(N, K, AS))) print '{}'.format(solve(N, K, AS)) '{}'.format '{}' format solve(N, K, AS) solve N K AS if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS))) def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS))) main def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1) def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1) ncut def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item() def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item() solve
#!/usr/bin/env python3

import os
import sys
import numpy as np

def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1)

def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item()


def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS)))

if __name__ == '__main__':
  main()