dynamic programming test