import std.stdio, std.conv, std.string, std.array, std.math, std.regex, std.range, std.ascii, std.numeric, std.random;
import std.typecons, std.functional, std.traits,std.concurrency;
import std.algorithm, std.container; import core.bitop, core.time, core.memory; import std.datetime;
import std.bitmanip;
import std.regex;

void main(){
    auto N = scanElem;
    auto K = scanElem;
    auto list = scanLineArray;

    struct E{
        long n, count;
    }
    real func(long n)
    {
        long count;
        foreach(e; list)
        {
            auto c = binarySearch!(a=>ceil(e/real(a+1))<=n)(K, -1);
            count += c;
        }
        return count<=K;
    }
    binarySearch!func(list.reduce!max, 0).end;
}

//辞書順順列はiota(1,N),nextPermituionを使う

enum INF = long.max/3;
enum MOD = 10L^^9+7;
enum AlphabetCount = 'z'-'a'+1L;

T binarySearch(alias F, T)(T ok, T ng, long iter=100)
{
    alias FF = unaryFun!F;
    foreach(_;0..iter)
    {
        auto n = (ok+ng)/2;
        if(FF(n)){
            ok = n;
        }else{
            ng = n;
        }
        static if(isIntegral!T){
            if(abs(ok-ng)==1)return ok;
        }
    }
    return ok;
}
