(async () => {
    let input = '';
    for await (const chunk of process.stdin) input += chunk;
    const lines = input.split(/\n/);
    const [n, k] = lines.shift().split(/\s/).map(v => +v);
    let a = lines[0].split(/\s/).slice(0, n).map(v => +v);

    let min = 0;
    let max = 1e9;
    while(Math.abs(max - min) > 1){
        const mid = Math.ceil((max + min) / 2);
        if(a.reduce((count, a) => count + Math.ceil(a / mid) - 1, 0) <= k){
            max = mid;
        }else{
            min = mid;
        }
    }
    console.log(Math.ceil(max));
})()
