Problem Statement
JOI-kun is about to buy apples.
Buying $1$ apple costs $X$ yen. Also, when buying apples in a set of $2$, they can be bought at $Y$ yen per $1$ apple ($2Y$ yen per $1$ set). Here, $Y < X$ holds.
When buying a total of exactly $N$ apples by combining individual $1$-apple purchases and sets of $2$ apples, find the minimum amount of money to pay.
Constraints
- $1 \le X \le 100$.
- $1 \le Y \le 100$.
- $1 \le N \le 100$.
- $Y < X$.
- All input values are integers.
Input
The input is given in the following format:
X Y N
Output
Output the minimum amount of money to pay when buying a total of exactly $N$ apples, omitting the unit (yen).
Do not output anything other than the answer. (Do not output sentences prompting for input, etc.)
For the output format, you may also refer to Practice Problems and Their Sample Solutions.
Sample Input $1$
4 3 5
Sample Output $1$
16
If he buys $1$ apple for $4$ yen and buys $2$ sets of $2$ apples ($2 \times 2 = 4$ apples in total), the total cost is $4 \times 1 + 3 \times 4 = 16$ yen. Since it is impossible to buy them cheaper with any other way of buying, output $16$.
Sample Input $2$
3 1 6
Sample Output $2$
6
Buying $3$ sets of $2$ apples is the cheapest. Therefore, the total cost is $1 \times 2 \times 3 = 6$ yen.
Sample Input $3$
10 2 1
Sample Output $3$
10
Since he buys $1$ apple for $10$ yen, the total cost is $10 \times 1 = 10$ yen. Note here that because he must buy a total of exactly $N$ apples, he cannot buy an extra set of $2$ apples for $2 \times 2 = 4$ yen.