import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
dprint("n, k = ", n, k)

lx = int(0)   # NG
rx = int(1e9) # OK
#ans = 0
while ((rx-lx)>1):
    x = (rx + lx) // 2
    dprint("lx, x, rx = ", lx, x, rx)
    n = 0
    for i in range(len(A)):
        #n += math.ceil(A[i] / x) - 1
        n += (A[i]-1) // x
        if n > k: break
    dprint("n = ", n)
    if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

#ans = math.ceil(rx)
print(rx) import sys sys import math math import time time sys.setrecursionlimit(int(1e6)) sys.setrecursionlimit sys setrecursionlimit int(1e6) int 1e6 if False:
    dprint = print
else:
    def dprint(*args):
        pass False dprint = print dprint print def dprint(*args):
        pass dprint *args n, k = list(map(int, input().split())) n list(map(int, input().split())) list 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 dprint("n, k = ", n, k) dprint "n, k = " n k lx = int(0) lx int(0) int 0 rx = int(1e9) rx int(1e9) int 1e9 while ((rx-lx)>1):
    x = (rx + lx) // 2
    dprint("lx, x, rx = ", lx, x, rx)
    n = 0
    for i in range(len(A)):
        #n += math.ceil(A[i] / x) - 1
        n += (A[i]-1) // x
        if n > k: break
    dprint("n = ", n)
    if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

#ans = math.ceil(rx) (rx-lx)>1 rx-lx rx lx 1 x = (rx + lx) // 2 x (rx + lx) // 2 rx + lx rx lx 2 dprint("lx, x, rx = ", lx, x, rx) dprint "lx, x, rx = " lx x rx n = 0 n 0 for i in range(len(A)):
        #n += math.ceil(A[i] / x) - 1
        n += (A[i]-1) // x
        if n > k: break
     i range(len(A)) range len(A) len A n += (A[i]-1) // x n (A[i]-1) // x A[i]-1 A[i] A i 1 x if n > k: break
     n > k n k dprint("n = ", n) dprint "n = " n if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

#ans = math.ceil(rx) n <= k n k dprint(" smaller x") dprint " smaller x" rx = x rx x dprint(" cut less, bigger x") dprint " cut less, bigger x" lx = x lx x print(rx) print rx lx = int(0) int(0) lx def dprint(*args):
        pass def dprint(*args):
        pass dprint A = list(map(int, input().split())) list(map(int, input().split())) A x = (rx + lx) // 2 (rx + lx) // 2 x dprint = print print dprint rx = x x rx lx = x x lx n, k = list(map(int, input().split())) list(map(int, input().split())) n n += (A[i]-1) // x (A[i]-1) // x n rx = int(1e9) int(1e9) rx k = list(map(int, input().split())) list(map(int, input().split())) k n = 0 0 n
import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
dprint("n, k = ", n, k)

lx = int(0)   # NG
rx = int(1e9) # OK
#ans = 0
while ((rx-lx)>1):
    x = (rx + lx) // 2
    dprint("lx, x, rx = ", lx, x, rx)
    n = 0
    for i in range(len(A)):
        #n += math.ceil(A[i] / x) - 1
        n += (A[i]-1) // x
        if n > k: break
    dprint("n = ", n)
    if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

#ans = math.ceil(rx)
print(rx)
