创建于 2026/07/16 · 更新于 2026/07/16
You need to maximize the total decrease in a target's Health Points (HP) over an -round process. The total HP decrease can be negative (meaning the target's HP increased overall).
Initially, there are two parameters and . Over the course of rounds, in round (), the following events occur sequentially:
You need to output the maximum possible total HP decrease.
Note that you do not care about the intermediate HP values during the process; you only care about the difference between the target's initial HP and final HP after all rounds.
The first line contains integers , representing the number of attack rounds, the maximum number of skill uses, the continuous HP recovery multiplier, the fixed damage per attack, and the continuous damage multiplier, respectively.
The second line contains non-negative integers. The -th integer is , representing the number of times the recovery effect is applied in round .
For all testcases, , .
Output a single integer, representing the maximum possible decrease in the target's HP.
5 3 1 2 3
1 0 2 0 0
43
5 3 3 3 4
0 1 0 4 4
29
8 1 9 2 8
0 0 0 1 1 10 10 10
-520