Some hotel has set the following room rate:
X rubles per night, for the first K nights;
Y rubles per night, for (K+1)-th and subsequent nights.
Gromozek decided to stay at this hotel for N consecutive nights. Calculate the total cost of staying Gromozeka at this hotel.
Input
The input is 4 positive integers:
N,
K,
X,
Y (
\(1<=N,K<=10000\);
\(1<=Y<X< =10000\)). One number per line.
Imprint
Display the total cost of accommodation in this hotel.
Examples
| # |
Input |
Output |
Explanation |
| 1 |
5
3
10000
9000 |
48000 |
Accommodation cost:
10000 rub. for the 1st night;
10000 rub. for the 2nd night;
10000 rub. for the 3rd night;
9000 rub. for the 4th night;;
9000 rub. for the 5th night;
Total: 48,000 rubles.
|
| 2 |
2
3
10000
9000 |
20000 |
|