import math

def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K

A = []
[N, K] = input().split()
N = int(N)
K = int(K)
A = input().split()
ans = 0

l = 0
r = 10 ** 9

for i in range(N):
  A[i] = int(A[i])

while r - l > 1:
  x = (r + l) // 2
  if is_ok(A, x, K):
    r = x
  else:
    l = x
      
print(r) import math math def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K is_ok cut_count = 0 cut_count 0 for number in A:
    cut_count += (math.ceil(number / x)) - 1
   number A cut_count += (math.ceil(number / x)) - 1 cut_count (math.ceil(number / x)) - 1 math.ceil(number / x) math.ceil math ceil number / x number x 1 return cut_count <= K cut_count <= K cut_count K A A x x K K A = [] A [] [N, K] = input().split() [N, K] N K input().split() ().split () input split N = int(N) N int(N) int N K = int(K) K int(K) int K A = input().split() A input().split() ().split () input split ans = 0 ans 0 l = 0 l 0 r = 10 ** 9 r 10 ** 9 10 9 for i in range(N):
  A[i] = int(A[i]) i range(N) range N A[i] = int(A[i]) A[i] A i int(A[i]) int A[i] A i while r - l > 1:
  x = (r + l) // 2
  if is_ok(A, x, K):
    r = x
  else:
    l = x
       r - l > 1 r - l r l 1 x = (r + l) // 2 x (r + l) // 2 r + l r l 2 if is_ok(A, x, K):
    r = x
  else:
    l = x
       is_ok(A, x, K) is_ok A x K r = x r x l = x l x print(r) print r r = 10 ** 9 10 ** 9 r l = x x l def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K is_ok N = int(N) int(N) N ans = 0 0 ans K = int(K) int(K) K A = input().split() input().split() A l = 0 0 l x = (r + l) // 2 (r + l) // 2 x A = [] [] A r = x x r
import math

def is_ok(A, x, K):
  cut_count = 0
  for number in A:
    cut_count += (math.ceil(number / x)) - 1
  return cut_count <= K

A = []
[N, K] = input().split()
N = int(N)
K = int(K)
A = input().split()
ans = 0

l = 0
r = 10 ** 9

for i in range(N):
  A[i] = int(A[i])

while r - l > 1:
  x = (r + l) // 2
  if is_ok(A, x, K):
    r = x
  else:
    l = x
      
print(r)