A tourist ger camp on the shore of Lake Khövsgöl needs bottles of drinking water. The wholesale shop sells the water in packs of bottles for tugriks a pack, and it also sells single bottles for tugriks each.
The camp buys exactly bottles: as many full packs as it can without going over bottles, and the remaining bottles one by one. How many tugriks does the camp pay in total?
In sample 1 the 27 bottles are bought as packs ( bottles) and single bottles: tugriks.
One line with four integers: , , , .
The total the camp pays, in tugriks.
, , ,
This editor records if code is AI assisted. Write it yourself — if you are stuck, ask your teacher.