#P2223. [HNOI2001] 软件开发
[HNOI2001] 软件开发
Description
A software company is planning a -day software development schedule. According to the plan, on day , software developers are needed. To improve efficiency, the company provides many services for the developers. One of these services is to provide each developer with a disinfected towel every day. After being used for one day, the towel must be disinfected again before it can be used again.
There are two disinfection methods. Method takes days; method takes days. The cost of method is per towel, and the cost of method is per towel. Buying a new towel costs (a new towel is already disinfected and can be used on the same day). The manager is planning, for each of these days, how many new towels to buy, how many towels to send for method disinfection, and how many towels to send for method disinfection. Of course, the manager wants to minimize the total cost.
Your task is: determine, for each day, how many towels to buy, how many towels to send for method disinfection, and how many towels to send for method disinfection, so that during this -day development period, the total cost of providing towel service is minimized.
Input Format
The first line contains six integers .
The second line contains integers .
Output Format
Output a single integer, the minimal total cost.
4 1 2 3 2 1
8 2 1 6
38
Hint
Constraints For of the testdata, it is guaranteed that , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号