100 atcoder#ABC044A. [ABC044A] 高橋君とホテルイージー
[ABC044A] 高橋君とホテルイージー
Score : points
Problem Statement
There is a hotel with the following accommodation fee:
- yen (the currency of Japan) per night, for the first nights
- yen per night, for the -th and subsequent nights
Tak is staying at this hotel for consecutive nights. Find his total accommodation fee.
Constraints
- are integers.
Input
The input is given from Standard Input in the following format:
Output
Print Tak's total accommodation fee.
5
3
10000
9000
48000
The accommodation fee is as follows:
- yen for the -st night
- yen for the -nd night
- yen for the -rd night
- yen for the -th night
- yen for the -th night
Thus, the total is yen.
2
3
10000
9000
20000