Application of Dynamic Programming Model to Production Planning