{
input: {bpf: '15 2 3', hc: '5 10'},
output: 40,
}
function hamburgerProblem(bpf, hc) {
let [b, p, f] = bpf.split(' ').map((value) => parseInt(value))
const [h, c] = hc.split(' ').map((value) => parseInt(value))
let cProfit = 0
let hProfit = 0
if (h > c) {
const hamBs = Math.min(p, Math.floor(b / 2))
hProfit = hamBs * h
b -= hamBs * 2
const chickenBs = Math.min(f, Math.floor(b / 2))
cProfit = chickenBs * c
} else if (h < c) {
const chickenBs = Math.min(f, Math.floor(b / 2))
cProfit = chickenBs * c
b -= chickenBs * 2
const hamBs = Math.min(p, Math.floor(b / 2))
hProfit = hamBs * h
} else {
const bs = Math.min(f + p, Math.floor(b / 2))
cProfit = bs * c
}
return hProfit + cProfit
}