A stamp dispenser problem solution