from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

def is_ok(arg):
    count = 0
    for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
    return count <= k

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

n, k = MAP()
a = LIST()
if k == 0:
    print(max(a))
else:
    print(meguru_bisect(0, max(a)+1)) from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator import itemgetter from heapq import heapify,heappop,heappush from queue import Queue,LifoQueue,PriorityQueue from copy import deepcopy from time import time from functools import reduce import string string import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 def input() : return sys.stdin.readline().strip() input def INT()   : return int(input()) INT def MAP()   : return map(int,input().split()) MAP def LIST()  : return list(MAP()) LIST def is_ok(arg):
    count = 0
    for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
    return count <= k is_ok count = 0 count 0 for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
     i range(n) range n if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
     a[i] % arg != 0 a[i] % arg a[i] a i arg 0 count += a[i] // arg count a[i] // arg a[i] a i arg count += a[i] // arg - 1 count a[i] // arg - 1 a[i] // arg a[i] a i arg 1 return count <= k count <= k count k arg arg def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok meguru_bisect while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            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 if is_ok(mid):
            ok = mid
        else:
            ng = mid
     is_ok(mid) is_ok mid ok = mid ok mid ng = mid ng mid return ok ok ng ng ok ok n, k = MAP() n MAP() MAP k a = LIST() a LIST() LIST if k == 0:
    print(max(a))
else:
    print(meguru_bisect(0, max(a)+1)) k == 0 k 0 print(max(a)) print max(a) max a print(meguru_bisect(0, max(a)+1)) print meguru_bisect(0, max(a)+1) meguru_bisect 0 max(a)+1 max(a) max a 1 def input() : return sys.stdin.readline().strip() def input() : return sys.stdin.readline().strip() input n, k = MAP() MAP() n def is_ok(arg):
    count = 0
    for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
    return count <= k def is_ok(arg):
    count = 0
    for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
    return count <= k is_ok def INT()   : return int(input()) def INT()   : return int(input()) INT def MAP()   : return map(int,input().split()) def MAP()   : return map(int,input().split()) MAP def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok meguru_bisect a = LIST() LIST() a def LIST()  : return list(MAP()) def LIST()  : return list(MAP()) LIST k = MAP() MAP() k
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

def is_ok(arg):
    count = 0
    for i in range(n):
        if a[i] % arg != 0:
            count += a[i] // arg
        else:
            count += a[i] // arg - 1
    return count <= k

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

n, k = MAP()
a = LIST()
if k == 0:
    print(max(a))
else:
    print(meguru_bisect(0, max(a)+1))