process.stdin.resume();
process.stdin.setEncoding('utf-8');
 
let inputString = '';
let currentLine = 0;
 
process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});
 
process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });
    
    main();    
});
 
function readLine() {
    return inputString[currentLine++];
}

function main() {
  const [n, k] = readLine().split(/\s/).map(Number)
  const as = readLine().split(/\s/).map(Number)
  const sum = as.reduce((a, b) => a + b)
  const avg = Math.ceil(sum / (k + 1))
  console.log(binarySearch(
    v => {
      const count = as.reduce((acc, a) => acc + Math.ceil(a / v) - 1, 0)
      return count > k
    },
    avg
  ))
}

function binarySearch(compare, r, l = 1) {
  while (l < r) {
    const m = Math.floor((l + r) / 2)
    if (compare(m - 1)) {
      if (!compare(m)) {
        return m
      }
      l = m + 1
      continue
    }
    r = m
  }
  return compare(l) ? l - 1 : l
}