dynamic programming on adding coins