Dynamic programming method in the tasks of optimal labor capital distribution programs