第 044 场 AtCoder Beginner Contest
A
Tak 与酒店(ABC 改编版)
Tak and Hotels (ABC Edit)
AtCoder
⌀ 0
原题
←B →

Tak 与酒店(ABC 改编版)AI (CI翻译)

Problem Statement

题目描述

AI (CI翻译)

There is a hotel with the following accommodation fee:

这家酒店的住宿费用如下:AI (CI翻译)

  • $X$ yen (the currency of Japan) per night, for the first $K$ nights
  • $Y$ yen per night, for the $(K+1)$-th and subsequent nights
  • 前 $K$ 晚每晚 $X$ 日元(日本的货币)
  • 从第 $(K+1)$ 晚开始,每晚 $Y$ 日元
AI (CI翻译)

Tak is staying at this hotel for $N$ consecutive nights. Find his total accommodation fee.

Tak 将在这家酒店连续住宿 $N$ 晚。请计算他的住宿总费用。AI (CI翻译)

Constraints

约束条件

AI (CI翻译)
  • $1 \leq N, K \leq 10000$
  • $1 \leq Y < X \leq 10000$
  • $N,\,K,\,X,\,Y$ are integers.
  • $1 \leq N, K \leq 10000$
  • $1 \leq Y < X \leq 10000$
  • $N,\,K,\,X,\,Y$ 均为整数。
AI (CI翻译)

Input

输入格式

AI (CI翻译)

The input is given from Standard Input in the following format:

输入从标准输入中按以下格式给出:AI (CI翻译)

N
K
X
Y

N
K
X
Y
AI (CI翻译)

Output

输出格式

AI (CI翻译)

Print Tak's total accommodation fee.

输出 Tak 的住宿总费用。AI (CI翻译)

样例

Input #1
5
3
10000
9000
Output #1
48000
The accommodation fee is as follows: - $10000$ yen for the $1$-st night - $10000$ yen for the $2$-nd night - $10000$ yen for the $3$-rd night - $9000$ yen for the $4$-th night - $9000$ yen for the $5$-th night Thus, the total is $48000$ yen.
Input #2
2
3
10000
9000
Output #2
20000
题目信息
题号
abc044_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。