import math

def cut(l,A,K):
    counter = 0
    i = N - 1
    if l == 0:
        return False
    while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
    if counter <= K:
        return True
    else:
        return False
    
if __name__ == '__main__':
    N,K = map(int,input().split())
    A = [float(a) for a in input().split()]
    A.sort()
    left = 0
    right = math.ceil(A[-1])
    while left <= right:
        middle = (left + right) // 2
        if cut(middle,A,K):
            if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
        else:
            left = middle + 1
    print(middle) import math math def cut(l,A,K):
    counter = 0
    i = N - 1
    if l == 0:
        return False
    while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
    if counter <= K:
        return True
    else:
        return False
     cut counter = 0 counter 0 i = N - 1 i N - 1 N 1 if l == 0:
        return False
     l == 0 l 0 return False False while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
     i >= 0 i 0 c = math.ceil(A[i] / l) - 1 c math.ceil(A[i] / l) - 1 math.ceil(A[i] / l) math.ceil math ceil A[i] / l A[i] A i l 1 if c == 0:
            break
        else:
            counter += c
            i -= 1
     c == 0 c 0 break counter += c counter c i -= 1 i 1 if counter <= K:
        return True
    else:
        return False
     counter <= K counter K return True True return False False l l A A K K if __name__ == '__main__':
    N,K = map(int,input().split())
    A = [float(a) for a in input().split()]
    A.sort()
    left = 0
    right = math.ceil(A[-1])
    while left <= right:
        middle = (left + right) // 2
        if cut(middle,A,K):
            if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
        else:
            left = middle + 1
    print(middle) __name__ == '__main__' __name__ '__main__' N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K float(a) for a in input().split() for a in input().split() a input().split() ().split () input split for a in input().split() float(a) float a A = [float(a) for a in input().split()] A [float(a) for a in input().split()] A.sort() A.sort A sort left = 0 left 0 right = math.ceil(A[-1]) right math.ceil(A[-1]) math.ceil math ceil A[-1] A -1 while left <= right:
        middle = (left + right) // 2
        if cut(middle,A,K):
            if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
        else:
            left = middle + 1
     left <= right left right middle = (left + right) // 2 middle (left + right) // 2 left + right left right 2 if cut(middle,A,K):
            if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
        else:
            left = middle + 1
     cut(middle,A,K) cut middle A K if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
         not cut(middle-1,A,K) cut(middle-1,A,K) cut middle-1 middle 1 A K break right = middle - 1 right middle - 1 middle 1 left = middle + 1 left middle + 1 middle 1 print(middle) print middle def cut(l,A,K):
    counter = 0
    i = N - 1
    if l == 0:
        return False
    while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
    if counter <= K:
        return True
    else:
        return False
     def cut(l,A,K):
    counter = 0
    i = N - 1
    if l == 0:
        return False
    while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
    if counter <= K:
        return True
    else:
        return False
     cut K = map(int,input().split()) map(int,input().split()) K N,K = map(int,input().split()) map(int,input().split()) N A = [float(a) for a in input().split()] [float(a) for a in input().split()] A right = math.ceil(A[-1]) math.ceil(A[-1]) right middle = (left + right) // 2 (left + right) // 2 middle left = 0 0 left right = middle - 1 middle - 1 right left = middle + 1 middle + 1 left
import math

def cut(l,A,K):
    counter = 0
    i = N - 1
    if l == 0:
        return False
    while i >= 0:
        c = math.ceil(A[i] / l) - 1
        if c == 0:
            break
        else:
            counter += c
            i -= 1
    if counter <= K:
        return True
    else:
        return False
    
if __name__ == '__main__':
    N,K = map(int,input().split())
    A = [float(a) for a in input().split()]
    A.sort()
    left = 0
    right = math.ceil(A[-1])
    while left <= right:
        middle = (left + right) // 2
        if cut(middle,A,K):
            if not cut(middle-1,A,K):
                break
            else:
                right = middle - 1
        else:
            left = middle + 1
    print(middle)