#P4624. [CTSC2000] 采矿【测试数据有误】
[CTSC2000] 采矿【测试数据有误】
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 . The other is called “gas mineral”, an allotrope form of carbon tetrachloride.
Humans refine these two minerals to obtain energy for survival. is the only intelligent robot that can collect both kinds of minerals. Each time it collects an ice mineral, it takes time; each time it collects a gas mineral, it takes time. After a collection is finished, it yields units of ice mineral or units of gas mineral. Each time, an can only collect one of the two types: ice mineral or gas mineral.
can be produced by the main base. For each produced, the main base will spend units of ice mineral. Due to limited manufacturing capacity, the main base can only produce one at the same time. Producing one takes time.
At the beginning, humans have units of ice mineral and s. They need to collect units of ice mineral and units of gas mineral. Please compute the minimum time they need.
Input Format
The input file contains only one line, in order: , , , , , 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.
10 9 18 150 0
40
Hint
, . The data is chosen randomly and uniformly from valid data.
Constraints
Translated by ChatGPT 5
京公网安备 11011102002149号