function main(input) { let [b] = getIntegers(input); let [n] = getIntegers(input); let c = input.map(x => Number(x)); let low = 0; let high = Math.floor(c.reduce((a, b) => a + b, b) / n); while (high - low > 2) { let c1 = Math.floor((low * 2 + high) / 3); let c2 = Math.floor((low + high * 2) / 3); if (solve(c1, c) > solve(c2, c)) { low = c1; } else { high = c2; } } let min = Number.MAX_SAFE_INTEGER; for(let i=low; i<=high; i++) { min = Math.min(min, solve(i, c)); } console.log(min); } function solve(v, c) { let num = 0; for(let i=0; i 0) str += " "; str += e; }); return str; }; main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n"));