def check(N,target,A,K):
  cnt = 0
  for i in range(N):
    cnt += -(-A[i]//target)-1
  if cnt>K:
    return False
  return True

def solve():
  ans = 0
  N, K = map(int, input().split())
  A = list(map(int, input().split()))
  low = 1
  high = 10**9+1
  mid = (low+high)//2
  while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
  if check(N,low,A,K):
    ans = low
  else:
    ans = high
  return ans
print(solve()) def check(N,target,A,K):
  cnt = 0
  for i in range(N):
    cnt += -(-A[i]//target)-1
  if cnt>K:
    return False
  return True check cnt = 0 cnt 0 for i in range(N):
    cnt += -(-A[i]//target)-1
   i range(N) range N cnt += -(-A[i]//target)-1 cnt -(-A[i]//target)-1 -(-A[i]//target) -A[i]//target -A[i] A[i] A i target 1 if cnt>K:
    return False
   cnt>K cnt K return False False return True True N N target target A A K K def solve():
  ans = 0
  N, K = map(int, input().split())
  A = list(map(int, input().split()))
  low = 1
  high = 10**9+1
  mid = (low+high)//2
  while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
  if check(N,low,A,K):
    ans = low
  else:
    ans = high
  return ans solve ans = 0 ans 0 N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split low = 1 low 1 high = 10**9+1 high 10**9+1 10**9 10 9 1 mid = (low+high)//2 mid (low+high)//2 low+high low high 2 while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
   high>low+1 high low+1 low 1 if check(N,mid,A,K):
      high = mid
    else:
      low = mid
     check(N,mid,A,K) check N mid A K high = mid high mid low = mid low mid mid = (low+high)//2 mid (low+high)//2 low+high low high 2 if check(N,low,A,K):
    ans = low
  else:
    ans = high
   check(N,low,A,K) check N low A K ans = low ans low ans = high ans high return ans ans print(solve()) print solve() solve def solve():
  ans = 0
  N, K = map(int, input().split())
  A = list(map(int, input().split()))
  low = 1
  high = 10**9+1
  mid = (low+high)//2
  while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
  if check(N,low,A,K):
    ans = low
  else:
    ans = high
  return ans def solve():
  ans = 0
  N, K = map(int, input().split())
  A = list(map(int, input().split()))
  low = 1
  high = 10**9+1
  mid = (low+high)//2
  while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
  if check(N,low,A,K):
    ans = low
  else:
    ans = high
  return ans solve def check(N,target,A,K):
  cnt = 0
  for i in range(N):
    cnt += -(-A[i]//target)-1
  if cnt>K:
    return False
  return True def check(N,target,A,K):
  cnt = 0
  for i in range(N):
    cnt += -(-A[i]//target)-1
  if cnt>K:
    return False
  return True check
def check(N,target,A,K):
  cnt = 0
  for i in range(N):
    cnt += -(-A[i]//target)-1
  if cnt>K:
    return False
  return True

def solve():
  ans = 0
  N, K = map(int, input().split())
  A = list(map(int, input().split()))
  low = 1
  high = 10**9+1
  mid = (low+high)//2
  while high>low+1:
    if check(N,mid,A,K):
      high = mid
    else:
      low = mid
    mid = (low+high)//2
  if check(N,low,A,K):
    ans = low
  else:
    ans = high
  return ans
print(solve())
