#P2134. 百日旅行
百日旅行
Description
Xiaoming and Xiaohong have days of vacation left, and Xiaoming can plan the trip. If they travel for consecutive days, Xiaoming needs to spend yuan. If they do not travel for consecutive days, Xiaoming needs to treat Xiaohong to meals, costing yuan ( are constants given in the input).
Please help Xiaoming write a program to compute the minimum total amount he needs to spend during the vacation.
Input Format
The input contains a single line with three space-separated positive integers .
Output Format
Output one line with a single positive integer, representing the minimum amount of money Xiaoming needs to spend.
6 1 7
20
Hint
Constraints
- For of the testdata, .
- For of the testdata, , , .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号