Sir when i is odd, we will check only for (i-1)th and (i+1)th term
i.e. dp[i] = min(dp[i-1] +y, dp[i+1/2] +x+z)
but for (i+1)th term how you are ensuring that (dp[i+1/2]+x+z]) is minimum value for (i+1)th term. Since it has dependency on (i+2)th term as well.