A generalization of the Hölder inequality through dynamic programming approach