import sys
import math
import itertools
import collections
from collections import deque
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD2 = 998244353
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N, K = NMI()
    A = NLI()
    
    ng = 0       #ng:とり得る最小の値-1
    ok = 10**9+10  #ok:とり得る最大の値+1

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

    print(ok)
    

if __name__ == '__main__':
    main() import sys sys import math math import itertools itertools import collections collections from collections import deque from collections import defaultdict sys.setrecursionlimit(1000000) sys.setrecursionlimit sys setrecursionlimit 1000000 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 MOD2 = 998244353 MOD2 998244353 INF = float('inf') INF float('inf') float 'inf' input = lambda: sys.stdin.readline().strip() input lambda: sys.stdin.readline().strip() sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip NI = lambda: int(input()) NI lambda: int(input()) int(input()) int input() input NMI = lambda: map(int, input().split()) NMI lambda: map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split NLI = lambda: list(NMI()) NLI lambda: list(NMI()) list(NMI()) list NMI() NMI SI = lambda: input() SI lambda: input() input() input def main():
    N, K = NMI()
    A = NLI()
    
    ng = 0       #ng:とり得る最小の値-1
    ok = 10**9+10  #ok:とり得る最大の値+1

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

    print(ok)
     main N, K = NMI() N NMI() NMI K A = NLI() A NLI() NLI ng = 0 ng 0 ok = 10**9+10 ok 10**9+10 10**9 10 9 10 while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

     abs(ok - ng) > 1 abs(ok - ng) abs ok - ng ok ng 1 mid = (ok + ng) // 2 mid (ok + ng) // 2 ok + ng ok ng 2 cut = 0 cut 0 for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


         a A if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


         a % mid == 0 a % mid a mid 0 cut += math.floor(a/mid)-1 cut math.floor(a/mid)-1 math.floor(a/mid) math.floor math floor a/mid a mid 1 cut += math.floor(a/mid) cut math.floor(a/mid) math.floor math floor a/mid a mid if cut <= K:
            ok = mid
        else:
            ng = mid

     cut <= K cut K ok = mid ok mid ng = mid ng mid print(ok) print ok if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = lambda: sys.stdin.readline().strip() lambda: sys.stdin.readline().strip() input INF = float('inf') float('inf') INF NMI = lambda: map(int, input().split()) lambda: map(int, input().split()) NMI NLI = lambda: list(NMI()) lambda: list(NMI()) NLI MOD2 = 998244353 998244353 MOD2 NI = lambda: int(input()) lambda: int(input()) NI MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD def main():
    N, K = NMI()
    A = NLI()
    
    ng = 0       #ng:とり得る最小の値-1
    ok = 10**9+10  #ok:とり得る最大の値+1

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

    print(ok)
     def main():
    N, K = NMI()
    A = NLI()
    
    ng = 0       #ng:とり得る最小の値-1
    ok = 10**9+10  #ok:とり得る最大の値+1

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

    print(ok)
     main SI = lambda: input() lambda: input() SI
import sys
import math
import itertools
import collections
from collections import deque
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD2 = 998244353
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N, K = NMI()
    A = NLI()
    
    ng = 0       #ng:とり得る最小の値-1
    ok = 10**9+10  #ok:とり得る最大の値+1

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2

        cut = 0
        for a in A:
            if a % mid == 0:
                cut += math.floor(a/mid)-1
            else:
                cut += math.floor(a/mid)


        if cut <= K:
            ok = mid
        else:
            ng = mid

    print(ok)
    

if __name__ == '__main__':
    main()