A mint-problem-like problem, or a fibonacci like dynamic programming prolem.