P4624 [CTSC2000] Mining [The testdata is incorrect]
Background
A human spacecraft has built a human base on a desolate planet. Facing a severe energy shortage, they can only use $\text{SCV}$ (an intelligent robot) to collect the required minerals in the shortest possible time. For this difficult task, they hope to get help from skilled programmers.
Description
On this planet, there are two different kinds of minerals. One is called “ice mineral”, a blue high-energy mineral that is a solid similar to $\text{H}_{2}\text{O}$. The other is called “gas mineral”, an allotrope form of carbon tetrachloride.
Humans refine these two minerals to obtain energy for survival. $\text{SCV}$ is the only intelligent robot that can collect both kinds of minerals. Each time it collects an ice mineral, it takes $t_{1}$ time; each time it collects a gas mineral, it takes $t_{2}$ time. After a collection is finished, it yields $8$ units of ice mineral or $8$ units of gas mineral. **Each time, an $\text{SCV}$ can only collect one of the two types: ice mineral or gas mineral.**
$\text{SCV}$ can be produced by the main base. For each $\text{SCV}$ produced, the main base will spend $50$ units of ice mineral. Due to limited manufacturing capacity, the main base can only produce **one** $\text{SCV}$ at the same time. Producing one $\text{SCV}$ takes $t_{3}$ time.
At the beginning, humans have $50$ units of ice mineral and $4$ $\text{SCV}$s. They need to collect $p_{1}$ units of ice mineral and $p_{2}$ units of gas mineral. Please compute the **minimum time** they need.
Input Format
The input file contains only one line, in order: $t_{1}$, $t_{2}$, $t_{3}$, $p_{1}$, $p_{2}$, with one space between every two numbers.
Output Format
The output file contains only one number, which is the minimum time needed to reach the goal.
Explanation/Hint
$1 \leq t_{1}, t_{2}, t_{3} \leq 18$, $0 \leq p_{1}, p_{2} \leq 150$. The data is chosen randomly and uniformly from valid data.
# Constraints
Translated by ChatGPT 5