#!/usr/bin/env python3
import sys
from itertools import chain


def cut_count(A, m):
    """最長の長さ(切り上げ)がm以下になるような切断回数"""
    total = 0
    for a in A:
        n = (a - 1) // m
        total += n
    return total


def solve(N: int, K: int, A: "List[int]"):
    r = max(A)
    l = 0
    while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
    return r


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, K, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, K, A)
    print(answer)


if __name__ == "__main__":
    main() import sys sys from itertools import chain def cut_count(A, m):
    """最長の長さ(切り上げ)がm以下になるような切断回数"""
    total = 0
    for a in A:
        n = (a - 1) // m
        total += n
    return total cut_count """最長の長さ(切り上げ)がm以下になるような切断回数""" total = 0 total 0 for a in A:
        n = (a - 1) // m
        total += n
     a A n = (a - 1) // m n (a - 1) // m a - 1 a 1 m total += n total n return total total A A m m def solve(N: int, K: int, A: "List[int]"):
    r = max(A)
    l = 0
    while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
    return r solve r = max(A) r max(A) max A l = 0 l 0 while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
     l + 1 < r l + 1 l 1 r m = (r + l) // 2 m (r + l) // 2 r + l r l 2 if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
     cut_count(A, m) <= K cut_count(A, m) cut_count A m K r = m r m l = m l m return r r N: int N K: int K A: "List[int]" A def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, K, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, K, A)
    print(answer) main line.split() for line in sys.stdin for line in sys.stdin line sys.stdin sys stdin for line in sys.stdin line.split() line.split line split tokens = chain(*(line.split() for line in sys.stdin)) tokens chain(*(line.split() for line in sys.stdin)) chain *(line.split() for line in sys.stdin) (line.split() for line in sys.stdin) N = int(next(tokens)) N int(next(tokens)) int next(tokens) next tokens K = int(next(tokens)) K int(next(tokens)) int next(tokens) next tokens int(next(tokens)) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) int(next(tokens)) int next(tokens) next tokens A = [int(next(tokens)) for _ in range(N)] A [int(next(tokens)) for _ in range(N)] answer = solve(N, K, A) answer solve(N, K, A) solve N K A print(answer) print answer if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def cut_count(A, m):
    """最長の長さ(切り上げ)がm以下になるような切断回数"""
    total = 0
    for a in A:
        n = (a - 1) // m
        total += n
    return total def cut_count(A, m):
    """最長の長さ(切り上げ)がm以下になるような切断回数"""
    total = 0
    for a in A:
        n = (a - 1) // m
        total += n
    return total cut_count def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, K, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, K, A)
    print(answer) def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, K, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, K, A)
    print(answer) main def solve(N: int, K: int, A: "List[int]"):
    r = max(A)
    l = 0
    while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
    return r def solve(N: int, K: int, A: "List[int]"):
    r = max(A)
    l = 0
    while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
    return r solve
#!/usr/bin/env python3
import sys
from itertools import chain


def cut_count(A, m):
    """最長の長さ(切り上げ)がm以下になるような切断回数"""
    total = 0
    for a in A:
        n = (a - 1) // m
        total += n
    return total


def solve(N: int, K: int, A: "List[int]"):
    r = max(A)
    l = 0
    while l + 1 < r:
        m = (r + l) // 2
        if cut_count(A, m) <= K:
            r = m  # r は K回以下の切断回数で到達できる長さ
        else:
            l = m  # l は K回より多いの切断回数で到達できる長さ
    # print(l, r)
    return r


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    # N, K, A = map(int, line.split())
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    answer = solve(N, K, A)
    print(answer)


if __name__ == "__main__":
    main()
