#P1615. Zhu Bajie's Laptop Heist
Zhu Bajie's Laptop Heist
Zhu Bajie's Laptop Heist
After an unexpected career change from ancient adventures to modern economics, Zhu Bajie found himself in a financial crisis. His company is bleeding money and his time is limited. Knowing that Sun Wukong is about to steal his belongings at time T1 and that he must dash to snatch Sha Monk's notebooks at time T2, Zhu Bajie has devised a cunning plan.
Every second, he can pilfer n notebooks from Sha Monk. Your mission is to help him calculate the maximum number of notebooks he can steal in the available time, ensuring he has enough time to prepare a defense against his senior.
The formula to compute the number of stolen notebooks is given by:
$$\text{notebooks} = \max(0, (T_1 - T_2) \times n)$$
If T1 is less than or equal to T2, then he has no time to steal anything and the answer is 0.
inputFormat
The input consists of a single line containing three integers separated by spaces:
- T1 (the time at which Sun Wukong arrives to steal Zhu Bajie's belongings),
- T2 (the time at which Zhu Bajie starts his heist on Sha Monk's notebooks),
- n (the number of notebooks Zhu Bajie can steal per second).
It is guaranteed that all input values are integers.
outputFormat
Output a single integer denoting the maximum number of notebooks Zhu Bajie can steal during the available time period.
sample
10 5 3
15