You will be given three integers a, b and k. You can perform one of the following two operations maximum k times.
You have to maximize the value of a×b after performing all the operations.
The first line of the input contains three integers a, b and k (1 ≤ a, b, k ≤ 1000).
Print the maximum value of a×b after performing the above operations maximum k times.
Input | Output |
---|---|
2 4 3 | 20 |
In this case, we can perform the increase operations on the value a by k times. So after all the operations are done a will become 5 and b will be 4. Our final result is 4×5 = 20. This is the maximum possible answer that we can get in optimal strategy. |
Input | Output |
---|---|
20 30 16 | 1089 |
Input | Output |
---|---|
50 55 6 | 3080 |
Input | Output |
---|---|
5 9 3 | 72 |