You, a former International Collegiate Programming Contest player, have now become an Assistant Cost Manager of Advanced Computer Manufacturing company. There are so many different kinds of costs you should deal with, including material cost, manufacturing cost and warehouse cost. Also, the customer's demand must be fully satisfied. Moreover, the space of warehouse is limited. To make things worse, all these parameters vary with time. To resolve this matter once for all, you decide to use your algorithmic knowledge to write a program.
Specifically, you have to find an optimal operational planning for the next $k$ months, under the following constraints: $\textbf{in the i-th month}$,
- the price of raw materials is $c_i$ yuan per unit, and the quantity of raw materials you purchase is not limited.
- the customer's demand is $d_i$ computers, that is, you must sell exactly $d_i$ computers to customers this month.
- your company can manufacture at most $p_i$ computers. Manufacturing one computer consumes one unit of raw materials plus a manufacturing cost of $m_i$ yuan.
- you can store raw materials and computers in the warehouse for future use. According to the regulations of your company, the raw materials and computers must be placed in two different areas of the warehouse. You can store at most $e_i$ computers to the next month. However, since the volume of raw materials is negligible, the number of raw materials you store is not limited. Storing one unit of raw materials or one computer to the next month takes $R_i$ yuan or $E_i$ yuan, respectively.
Also,
- you may immediately use the raw materials you purchase this month to manufacture computers, as long as the the production capacity of this month is enough; likewise, you may manufacture and sell computers in the same month. These raw materials and computers do not take up warehouse space.
- initially, there are no raw materials or computers in your company.
Your program should report whether all customer's demands can be fully satisfied, and, if so, report the minimum total cost.