Petty bureaucrat Victor Thiefton was disposed towards stealing from his childhood. But one thing is to legally privatize national factories, diamond fields and oil derricks at the cost of billions dollars. And another thing is
to filch some money from a poor regional budget. Our legislation is very strict. Therefore Victor felt that justice is on the alert just after he extracted his hand from the national pocket. What should he do to escape inevitable punishment?
Mr. Thiefton has once heard that in accordance with the criminal legislation standards he would be condemned to long imprisonment for a theft whereas in case of a peculation he could escape with a suspended sentence only. So
if the most part of stolen money is peculated, the duration of imprisonment will be reduced.
The same evening Mr. Thiefton burst into "MegaApril" superstore and rushed for overflowing storefronts carrying a purse with N stolen dollars. It appeared that unlimited number of high-quality goods and goods at moderate price
were on sale in the superstore. High-quality goods cost A dollars per piece, and goods at moderate price cost B dollars per piece. Victor should spend as much stolen money as possible to reduce the duration of imprisonment to a minimum.