https://www.acmicpc.net/problem/3079
const fs = require('fs')
const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n')
const [N, M] = input.shift().split(' ').map(BigInt)
const A = input.map(BigInt)
let [L, R] = [1n, 10n ** 9n * M]
while (L < R) {
const C = BigInt((L + R) / 2n)
const S = A.reduce((a, b) => a + BigInt(C / b), 0n)
S < M ? (L = C + 1n) : (R = C)
}
console.log(R.toString())