# -*- coding: utf-8 -*-

# template: v1.3.1



# 丸太の分割分割問題。

# 速度の観点から、「答えの二分探索」が必要。典型らしい。







import io

import sys

import math



### DEBUG ###

_DEB = 0   # 1:ON / 0:OFF



_INPUT = """\

2 1

1 50

"""



# Worst

# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"

# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"





_EXPECTED = """\

ABC

"""

if _DEB:

    sys.stdin = io.StringIO(_INPUT)

    print("!! Debug Mode !!")





def logd(str):

    if _DEB: print(f"[deb] {str}")



# is_m_OK?

def f(m):

    cut=0

    for aa in a:

        c=math.ceil(aa/m)

        cut+=c-1

        if cut > k:

            return False

    return True

#m=7,a=[7,9]





### INPUT ####

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

a = list(map(int, input().split()))



### Solve ####

def solve():

    # Process



    ans=0

    l,r=0,10**9

    while abs(r-l)!=1:

        m=(l+r)//2

        if f(m): # m is ok: Go left

            r=m

        else: # m is ng : Go right

            l=m

    

    ans=r

    # ans=min(r,max(a))



    # OUPUT

    ans = str(ans)

    print(ans)

    return ans



### MAIN ###

if __name__ == "__main__":

    ans = solve()



    # Checker

    if _DEB:

        if _EXPECTED.strip() == ans.strip(): print("\n!! Success !!")

        else: print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
# -*- coding: utf-8 -*-

# template: v1.3.1



# 丸太の分割分割問題。

# 速度の観点から、「答えの二分探索」が必要。典型らしい。

# f(x) の処理、すぬけさんのをチェック





import io

import sys

import math



### DEBUG ###

_DEB = 0   # 1:ON / 0:OFF



_INPUT = """\

2 1

1 3

"""



# Worst

# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"

# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"





_EXPECTED = """\

ABC

"""

if _DEB:

    sys.stdin = io.StringIO(_INPUT)

    print("!! Debug Mode !!")





def logd(str):

    if _DEB: print(f"[deb] {str}")



# is_m_OK?

def f(m):

    cut=0

    for aa in a:

        #ここを変えた

        c=(aa-1)//m 

        cut+=c

        if cut > k:

            return False

    return True

#m=7,a=[7,9]





### INPUT ####

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

a = list(map(int, input().split()))



### Solve ####

def solve():

    # Process



    ans=0

    l,r=0,10**9

    while abs(r-l)!=1:

        m=(l+r)//2

        if f(m): # m is ok: Go left

            r=m

        else: # m is ng : Go right

            l=m

    

    ans=r

    # ans=min(r,max(a))



    # OUPUT

    ans = str(ans)

    print(ans)

    return ans



### MAIN ###

if __name__ == "__main__":

    ans = solve()



    # Checker

    if _DEB:

        if _EXPECTED.strip() == ans.strip(): print("\n!! Success !!")

        else: print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
# -*- coding: utf-8 -*-
# template: v1.3.1
# 丸太の分割分割問題。
# 速度の観点から、「答えの二分探索」が必要。典型らしい。
import io
import sys
import math

### DEBUG ###
_DEB = 0  # 1:ON / 0:OFF
_INPUT = """\
2 1
1 50
"""
# Worst
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"
_EXPECTED = """\
ABC
"""
if _DEB:
    sys.stdin = io.StringIO(_INPUT)
    print("!! Debug Mode !!")


def logd(str):
    if _DEB:
        print(f"[deb] {str}")


# is_m_OK?
def f(m):
    cut = 0
    for aa in a:
        c = math.ceil(aa / m)
        cut += c - 1
        if cut > k:
            return False
    return True


# m=7,a=[7,9]
### INPUT ####
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
### Solve ####
def solve():
    # Process
    ans = 0
    l, r = 0, 10**9
    while abs(r - l) != 1:
        m = (l + r) // 2
        if f(m):  # m is ok: Go left
            r = m
        else:  # m is ng : Go right
            l = m
    ans = r
    # ans=min(r,max(a))
    # OUPUT
    ans = str(ans)
    print(ans)
    return ans


### MAIN ###
if __name__ == "__main__":
    ans = solve()
    # Checker
    if _DEB:
        if _EXPECTED.strip() == ans.strip():
            print("\n!! Success !!")
        else:
            print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

# -*- coding: utf-8 -*-
# template: v1.3.1
# 丸太の分割分割問題。
# 速度の観点から、「答えの二分探索」が必要。典型らしい。
# f(x) の処理、すぬけさんのをチェック
import io
import sys
import math

### DEBUG ###
_DEB = 0  # 1:ON / 0:OFF
_INPUT = """\
2 1
1 3
"""
# Worst
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"
_EXPECTED = """\
ABC
"""
if _DEB:
    sys.stdin = io.StringIO(_INPUT)
    print("!! Debug Mode !!")


def logd(str):
    if _DEB:
        print(f"[deb] {str}")


# is_m_OK?
def f(m):
    cut = 0
    for aa in a:
        # ここを変えた
        c = (aa - 1) // m
        cut += c
        if cut > k:
            return False
    return True


# m=7,a=[7,9]
### INPUT ####
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
### Solve ####
def solve():
    # Process
    ans = 0
    l, r = 0, 10**9
    while abs(r - l) != 1:
        m = (l + r) // 2
        if f(m):  # m is ok: Go left
            r = m
        else:  # m is ng : Go right
            l = m
    ans = r
    # ans=min(r,max(a))
    # OUPUT
    ans = str(ans)
    print(ans)
    return ans


### MAIN ###
if __name__ == "__main__":
    ans = solve()
    # Checker
    if _DEB:
        if _EXPECTED.strip() == ans.strip():
            print("\n!! Success !!")
        else:
            print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

+# f(x) の処理、すぬけさんのをチェック -1 50 +1 3 -        c = math.ceil(aa / m) -        cut += c - 1 +        # ここを変えた +        c = (aa - 1) // m +        cut += c