reformulate dynamic programming in terms of "exercises used"