import Foundation

func splitCount(_ a: [Int], _ x: Int) -> Int {
  let res = a.reduce(0) { $0 + Int(ceil(Double($1) / Double(x))) - 1 }
  return res
}

let inp = readLine()!.split(separator: " ").map { Int($0)! }
let n = inp[0]
let k = inp[1]

let a = readLine()!.split(separator: " ").map { Int($0)! }

var left = 1
var right = a.max()!

var ans = right

while left <= right {
  let mid = left + (right - left) / 2
  let c = splitCount(a, mid)
  if c <= k {
    ans = min(ans, mid)
    right = mid - 1
  } else {
    left = mid + 1
  }
}
print(ans)