当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5644:King's Pilots

题目描述
The military parade will last for $n$ days. There is a aerobatic flight shows everyday during the parade. On the $i$th day , $P_i$ pilots are required. But the pilots are not willing to work continually without an extra salary for even two days , because they are extremely tired.

There are $m$ Holiday formulations in this country. For each formulation $j$ , that is: when a pilot works on a day , if you pay him $S_j$ dollars he is willing to come back $T_j$ days after that day.

For example , If a pilot work on the $r$th day , and $T_j==1$ then he will return to work on $r+1$th day



At the very beginning there are k pilots , but of course you can hire more pilots. However , training new pilots require $P$ days and for each new pilot you need pay him $Q$ dollars. (Which means you can only use new pilots on $P$th day or later)

Now our great king needs you to plan all these things. There must be enough pilots everyday and the cost must be minimized. Please tell the king what is the lowest cost;
输入解释
The first line contains a number $T(T \le 5)$, the number of testcases.

For each testcase, the first line contains a number $n (n \le 200)$

On the second line , there are n numbers $P_i(1 \le i \le n)$ indicating the number of pilots needed on that day

On the third line , 3 numbers , $m(1 \le m \le 5) , P , Q$

On the following m lines , each line has two numbers: $S_i$ , $T_i$

all input data $x$ satisfy $x\in[0 , 200]$
输出解释
For each testcase, print a single number. The minimum cost.

If there is no solution , just put `No solution`
输入样例
1
5 10
1 3 5 10 6
1 3 5
2 2
输出样例
48
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #75

源链接: HDU-5644

最后修改于 2020-10-25T23:24:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)