問題一覧 > 通常問題

No.2150 Site Supporter

レベル : / AI推定難易度 : 700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 98
作問者 : ramdos / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 8800 / 自分の提出
問題文最終更新日: 2022-12-10 00:13:35
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2022 (順位表) の他の問題:

Problem Statement

In the year 29XX, Yukicoder has become a paid service.
Users other than site supporters must now pay $1$ yen per $1$ problem in order to solve problems.
Each day, a user can choose whether or not to be a site supporter. To be a site supporter, the user must pay a membership fee of $K$ yen per $1$ day, and, upon joining (that is, when a person who was not a site supporter on the previous day becomes a site supporter on the next day), an enrollment fee of $X$ yen.
Ramdos plans to solve past problems for $N$ days starting tomorrow, and he intends to solve $A_i$ problems on the day $i$ days from today.
As of today, Ramdos is not a site supporter. What is the minimum amount he must pay to achieve this goal?

Input

$N\ K\ X$
$A_1\ A_2\ \dots A_N$
  • $1 \le N \le 2 \times 10^5$
  • $1 \le K \le 10^9$
  • $1 \le X \le 10^9$
  • $1 \le A_i \le 10^9$
  • All inputs are integers.

Output

Output the minimum amount that must be paid.

Sample

Sample 1
Input
4 3 5
2 9 8 1
Output
14

If he is a supporter from day $2$ through day $3$, he pays $14$ yen.

The payment cannot be made less than $14$ yen, so output $14$.

Sample 2
Input
18 3 5
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3
Output
55
Sample 3
Input
7 10 3
6 9 5 2 3 1 4
Output
30

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。