def min_cut_num(n, L, size):
    cnt = 0
    for wood in L:
        cnt += ((wood + size - 1) // size) - 1
    return cnt
    

def main():
    n, k = map(int, input().split())
    L = list(map(int, input().split()))
    # k 回以内のカットで作成できる最小の上限サイズを特定する
    left = 0
    right = 10 ** 9    # 必ず k 回以内
    while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
    print(right)




if __name__ == '__main__':
    main() def min_cut_num(n, L, size):
    cnt = 0
    for wood in L:
        cnt += ((wood + size - 1) // size) - 1
    return cnt
     min_cut_num cnt = 0 cnt 0 for wood in L:
        cnt += ((wood + size - 1) // size) - 1
     wood L cnt += ((wood + size - 1) // size) - 1 cnt ((wood + size - 1) // size) - 1 (wood + size - 1) // size wood + size - 1 wood + size wood size 1 size 1 return cnt cnt n n L L size size def main():
    n, k = map(int, input().split())
    L = list(map(int, input().split()))
    # k 回以内のカットで作成できる最小の上限サイズを特定する
    left = 0
    right = 10 ** 9    # 必ず k 回以内
    while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
    print(right) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split left = 0 left 0 right = 10 ** 9 right 10 ** 9 10 9 while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
     right - left > 1 right - left right left 1 mid = (left + right) // 2 mid (left + right) // 2 left + right left right 2 if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
     min_cut_num(n, L, mid) <= k min_cut_num(n, L, mid) min_cut_num n L mid k right = mid right mid left = mid left mid print(right) print right if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def min_cut_num(n, L, size):
    cnt = 0
    for wood in L:
        cnt += ((wood + size - 1) // size) - 1
    return cnt
     def min_cut_num(n, L, size):
    cnt = 0
    for wood in L:
        cnt += ((wood + size - 1) // size) - 1
    return cnt
     min_cut_num def main():
    n, k = map(int, input().split())
    L = list(map(int, input().split()))
    # k 回以内のカットで作成できる最小の上限サイズを特定する
    left = 0
    right = 10 ** 9    # 必ず k 回以内
    while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
    print(right) def main():
    n, k = map(int, input().split())
    L = list(map(int, input().split()))
    # k 回以内のカットで作成できる最小の上限サイズを特定する
    left = 0
    right = 10 ** 9    # 必ず k 回以内
    while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
    print(right) main
def min_cut_num(n, L, size):
    cnt = 0
    for wood in L:
        cnt += ((wood + size - 1) // size) - 1
    return cnt
    

def main():
    n, k = map(int, input().split())
    L = list(map(int, input().split()))
    # k 回以内のカットで作成できる最小の上限サイズを特定する
    left = 0
    right = 10 ** 9    # 必ず k 回以内
    while right - left > 1:
        mid = (left + right) // 2
        if min_cut_num(n, L, mid) <= k:
            right = mid
        else:
            left = mid
    print(right)




if __name__ == '__main__':
    main()