fun main() = with(System.`in`.bufferedReader()) {
val (n,m) = readLine().split(" ").map{it.toInt()}
val list = readLine().split(" ").map{it.toLong()}
var max : Long = list.maxOrNull()!!*m
var min : Long= 0
while(min<=max){
val mid = (max+min)/2
var cnt = 0L
for(t in list){
cnt += mid/t
}
if(cnt<m){
min = mid+1
}
else{
max = mid-1
}
}
println(min)
}