#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans)) import math math N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K int(y) for y in input().split() for y in input().split() y input().split() ().split () input split for y in input().split() int(y) int y A = [int(y) for y in input().split()] A [int(y) for y in input().split()] Ma = max(A) Ma max(A) max A mi = 1 mi 1 ans = Ma ans Ma def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False execute count = 0 count 0 for i in A:
        count += math.ceil(i / f) - 1
     i A count += math.ceil(i / f) - 1 count math.ceil(i / f) - 1 math.ceil(i / f) math.ceil math ceil i / f i f 1 if count <= K:
        return True
    else:
        return False count <= K count K return True True return False False f f while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break True median = (Ma + mi) // 2 median (Ma + mi) // 2 Ma + mi Ma mi 2 bobo = execute(median) bobo execute(median) execute median if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
     bobo ans = min(ans,median) ans min(ans,median) min ans median Ma = median Ma median mi = median + 1 mi median + 1 median 1 if Ma == mi:
        break Ma == mi Ma mi break print("{}".format(ans)) print "{}".format(ans) "{}".format "{}" format ans A = [int(y) for y in input().split()] [int(y) for y in input().split()] A N,K = map(int,input().split()) map(int,input().split()) N ans = Ma Ma ans mi = median + 1 median + 1 mi median = (Ma + mi) // 2 (Ma + mi) // 2 median Ma = median median Ma Ma = max(A) max(A) Ma K = map(int,input().split()) map(int,input().split()) K ans = min(ans,median) min(ans,median) ans bobo = execute(median) execute(median) bobo def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False execute mi = 1 1 mi
#coding:utf-8
import math

N,K = map(int,input().split())

A = [int(y) for y in input().split()]

Ma = max(A)
mi = 1

ans = Ma

def execute(f):
    count = 0
    for i in A:
        count += math.ceil(i / f) - 1
    if count <= K:
        return True
    else:
        return False

while True:
    median = (Ma + mi) // 2
    
    bobo = execute(median)
    
    if bobo:
        ans = min(ans,median)
        Ma = median
    else:
        mi = median + 1
    
    if Ma == mi:
        break

print("{}".format(ans))