import math



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

a = [int(i) for i in input().split()]



a.sort()

r = a[n-1]

l = 0





def calc(t,x):

    return math.ceil(t / x) - 1





while r - l > 1:

    mid = (r+l)//2

    count = 0

    for i in a:

        count += calc(i,mid)

    if count > k:

        l = mid

    else:

        r = mid



print(r)

import math



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

a = [int(i) for i in input().split()]



a.sort()

r = a[n-1]

l = 0





def calc(t,x):

    return (t-1) // x





while r - l > 1:

    mid = (r+l)//2

    count = 0

    for i in a:

        count += calc(i,mid)

    if count > k:

        l = mid

    else:

        r = mid



print(r)

import math

n, k = list(map(int, input().split()))
a = [int(i) for i in input().split()]
a.sort()
r = a[n - 1]
l = 0


def calc(t, x):
    return math.ceil(t / x) - 1


while r - l > 1:
    mid = (r + l) // 2
    count = 0
    for i in a:
        count += calc(i, mid)
    if count > k:
        l = mid
    else:
        r = mid
print(r)

import math

n, k = list(map(int, input().split()))
a = [int(i) for i in input().split()]
a.sort()
r = a[n - 1]
l = 0


def calc(t, x):
    return (t - 1) // x


while r - l > 1:
    mid = (r + l) // 2
    count = 0
    for i in a:
        count += calc(i, mid)
    if count > k:
        l = mid
    else:
        r = mid
print(r)

-    return math.ceil(t / x) - 1 +    return (t - 1) // x