Example Of Dynamic Programming Problem