First, take a look at the question that you would have done earlier in stage 1, had you been in this competition. http://codersblock.net/ccc/2007/bowling/senior_stage1_2007.pdf The stage 1 solution requires that you break it into easier subproblems with dynamic programming. The stage 2 solution requires that you take add another dependency between these subproblems, to take into account what happens if we hit only (1, 2 ... w) additional pins. ********************* Stage 1 Solution Hint ********************* Let P(g, b) define the subproblem "What is the most number of points we can get if we are on our b'th ball, and only able to hit pins from g .. n?" Then P(g+1, b) gives us a smaller version of the same subproblem. Also, P(g+w, b+1) gives us the next subproblem if we decide to hit the current pins (g .. g+w). The maximum of these subproblems is the best solution for P(g, b). http://codersblock.net/ccc/2007/bowling/stage1_equation.gif A further set of subproblems are required for the stage 2 solution.