import std;
import core.bitop;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "x", long, "c");
alias PQueue(T, alias less = "a>b") = BinaryHeap!(Array!T, less);

void main()
{
    long n, k;
    scan(n, k);
    auto a = aryread();

    long ok = a.reduce!(max), ng = -1;
    while (abs(ok - ng) > 1)
    {
        long cntCut(long len)
        {
            return len > 0 ? a.map!(x => (x + len - 1) / len - 1).sum() : INF;
        }

        auto mid = (ok + ng) / 2;
        // writefln("mid = %s, counts = %s", mid, cntCut(mid));
        if (cntCut(mid) <= k)
            ok = mid;
        else
            ng = mid;
    }
    ok.writeln();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
