On the Principle of Optimality for Nonstationary Deterministic Dynamic Programming