from sys import stdin
from math import floor,ceil

N, K = map(int, input().rstrip().split())
A = [int(x) for x in stdin.readline().rstrip().split()]

def is_max_len_less_than_input(x,K,A):
  count = 0
  for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
  return True

def binary_search(begin,end,K,A):
  while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
  return end

print(binary_search(0,max(A),K,A)) from sys import stdin from math import floor,ceil N, K = map(int, input().rstrip().split()) N map(int, input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split K int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x A = [int(x) for x in stdin.readline().rstrip().split()] A [int(x) for x in stdin.readline().rstrip().split()] def is_max_len_less_than_input(x,K,A):
  count = 0
  for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
  return True is_max_len_less_than_input count = 0 count 0 for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
   ln A count += ceil(ln/x)-1 count ceil(ln/x)-1 ceil(ln/x) ceil ln/x ln x 1 if count > K:
      return False
   count > K count K return False False return True True x x K K A A def binary_search(begin,end,K,A):
  while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
  return end binary_search while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
   abs(end-begin)>1 abs(end-begin) abs end-begin end begin 1 mid = (begin+end)//2 mid (begin+end)//2 begin+end begin end 2 if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
   is_max_len_less_than_input(mid,K,A) is_max_len_less_than_input mid K A end = mid end mid begin = mid begin mid return end end begin begin end end K K A A print(binary_search(0,max(A),K,A)) print binary_search(0,max(A),K,A) binary_search 0 max(A) max A K A def binary_search(begin,end,K,A):
  while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
  return end def binary_search(begin,end,K,A):
  while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
  return end binary_search A = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] A K = map(int, input().rstrip().split()) map(int, input().rstrip().split()) K def is_max_len_less_than_input(x,K,A):
  count = 0
  for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
  return True def is_max_len_less_than_input(x,K,A):
  count = 0
  for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
  return True is_max_len_less_than_input N, K = map(int, input().rstrip().split()) map(int, input().rstrip().split()) N
from sys import stdin
from math import floor,ceil

N, K = map(int, input().rstrip().split())
A = [int(x) for x in stdin.readline().rstrip().split()]

def is_max_len_less_than_input(x,K,A):
  count = 0
  for ln in A:
    count += ceil(ln/x)-1
    if count > K:
      return False
  return True

def binary_search(begin,end,K,A):
  while abs(end-begin)>1:
    mid = (begin+end)//2
    if is_max_len_less_than_input(mid,K,A):
      end = mid
    else:
      begin = mid
  return end

print(binary_search(0,max(A),K,A))