DP: Minimum Coins. Refactoring Math