[math-fun] A grid with MAX (dynamic programming solution?)