The Strange Shopkeeper and His First Loss

S_Rifat Replay of Intra AUST Prog...
Limits 1s, 512 MB

Once upon a time there was a strange shopkeeper. He used to buy things and sell them with the same amount of money that he bought. That means, he never made any profit or loss in his life with his business. One day, the shopkeeper put X number of Y dollar notes at the top of his desk and started talking with his customers. At that time, a thief was passing by the shop and noticed the notes. He secretly took all the notes from the desk and went away. The next day, the thief came to the shop again to buy some biscuits. The thief gave him the same amount of money that he stole yesterday. The shopkeeper gave him some biscuits and returned him the remaining Z dollar because the price of the biscuits was not greater than the amount he received. As a result, the shopkeeper made some losses for the first time in his life. Would you help us to calculate the loss amount?


The input consists of three integers X, Y and Z.

1<=X<=51 <= X <= 5

1<=Y<=1091 <= Y <= 10^9


Print the loss amount.


1 1 0


Login to submit.


87% Solution Ratio
ApuOrghoEarliest, Feb '22
CodeWith_IsmailFastest, 0.0s
ApuOrghoLightest, 131 kB
SabbasachiSutradharShortest, 41B
Toph uses cookies. By continuing you agree to our Cookie Policy.