Tag - problems on dynamic programming