#P4624. [CTSC2000] 采矿【测试数据有误】

[CTSC2000] 采矿【测试数据有误】

Background

A human spacecraft has built a human base on a desolate planet. Facing a severe energy shortage, they can only use SCV\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.

Problem 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 H2O\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. SCV\text{SCV} is the only intelligent robot that can collect both kinds of minerals. Each time it collects an ice mineral, it takes t1t_{1} time; each time it collects a gas mineral, it takes t2t_{2} time. After a collection is finished, it yields 88 units of ice mineral or 88 units of gas mineral. Each time, an SCV\text{SCV} can only collect one of the two types: ice mineral or gas mineral.

SCV\text{SCV} can be produced by the main base. For each SCV\text{SCV} produced, the main base will spend 5050 units of ice mineral. Due to limited manufacturing capacity, the main base can only produce one SCV\text{SCV} at the same time. Producing one SCV\text{SCV} takes t3t_{3} time.

At the beginning, humans have 5050 units of ice mineral and 44 SCV\text{SCV}s. They need to collect p1p_{1} units of ice mineral and p2p_{2} units of gas mineral. Please compute the minimum time they need.

Input Format

The input file contains only one line, in order: t1t_{1}, t2t_{2}, t3t_{3}, p1p_{1}, p2p_{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.

10 9 18 150 0
40

Hint

1t1,t2,t3181 \leq t_{1}, t_{2}, t_{3} \leq 18, 0p1,p21500 \leq p_{1}, p_{2} \leq 150. The data is chosen randomly and uniformly from valid data.

Constraints

Translated by ChatGPT 5