# Arup Guha
# 11/17/2024
# Solution to 2024 SER D2 Problem M: Memories of Passport Stamps

# Get basic input.
toks = input().split()
n = int(toks[0])
trips = int(toks[1])

# Will be bounds for binary search.
lo = 1
hi = 1

# Store segments.
vals = []

# Read in.
for i in range(n):
    x = int(input())
    hi = max(hi, x)
    vals.append(x)

# Run binary search.
while lo < hi:

    # Try this.
    mid = (lo+hi)//2

    # Add the ceiling of each value divided by mid (s in problem)
    tot = 0
    for x in vals:
        tot += (x+mid-1)//mid

    # This is good enough so highest possible answer is mid.
    if tot <= trips:
        hi = mid

    # Not good enough so mid+1 is smallest possible.
    else:
        lo = mid+1

# Ta da!
print(lo)
