from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n, k = rl()
    A = rl()

    def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

    lo = 0
    hi = max(A)
    if k == 0:
        print (hi)
        return

    while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

    print (hi)
    return








mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve() from collections import defaultdict as dd from collections import deque import bisect bisect import heapq heapq def ri():
    return int(input()) ri return int(input()) int(input()) int input() input def rl():
    return list(map(int, input().split())) rl return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def solve():
    n, k = rl()
    A = rl()

    def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

    lo = 0
    hi = max(A)
    if k == 0:
        print (hi)
        return

    while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

    print (hi)
    return solve n, k = rl() n rl() rl k A = rl() A rl() rl def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

     check cuts = 0 cuts 0 for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
         a A cuts += (a - 1) // L cuts (a - 1) // L a - 1 a 1 L if cuts > k:
                return False
         cuts > k cuts k return False False return True True L L lo = 0 lo 0 hi = max(A) hi max(A) max A if k == 0:
        print (hi)
        return

     k == 0 k 0 print (hi) print hi return while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

     lo < hi - 1 lo hi - 1 hi 1 mid = (lo + hi) // 2 mid (lo + hi) // 2 lo + hi lo hi 2 if check(mid):
            hi = mid
        else:
            lo = mid

     check(mid) check mid hi = mid hi mid lo = mid lo mid print (hi) print hi return mode = 's' mode 's' if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve() mode == 'T' mode 'T' t = ri() t ri() ri for i in range(t):
        solve() i range(t) range t solve() solve solve() solve mode = 's' 's' mode def ri():
    return int(input()) def ri():
    return int(input()) ri t = ri() ri() t def rl():
    return list(map(int, input().split())) def rl():
    return list(map(int, input().split())) rl def solve():
    n, k = rl()
    A = rl()

    def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

    lo = 0
    hi = max(A)
    if k == 0:
        print (hi)
        return

    while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

    print (hi)
    return def solve():
    n, k = rl()
    A = rl()

    def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

    lo = 0
    hi = max(A)
    if k == 0:
        print (hi)
        return

    while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

    print (hi)
    return solve
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n, k = rl()
    A = rl()

    def check(L):
        cuts = 0
        for a in A:
            cuts += (a - 1) // L
            if cuts > k:
                return False
        return True

    lo = 0
    hi = max(A)
    if k == 0:
        print (hi)
        return

    while lo < hi - 1:
        mid = (lo + hi) // 2
        if check(mid):
            hi = mid
        else:
            lo = mid

    print (hi)
    return








mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()
