Multiple choices for a single case in the recursive formula of a Dynamic Programming algorithm
If you want to have two values for each stage, one for $t_{i - 1} = app$ and one for $t_{i - 1} = int$, which are derived from three or two cases respectivelly then you will need to store two dynamic programming values for each stage. Let's name these values for the $i$-th stage $z_{app, i}$ and $z_{int, i}$ respectively. $z_{app, i}$ is the minimum additive value of your objective function for stages up to the $i$-th one if you used (app) in the $i$-th stage, while $z_{int, i}$ has a similar definition. Now let's see what the format of the dp recursion will look like:

$
z_{app, i} = min
\begin{cases}
z_{int, i - 1} + p + (app), &amp; \text{if } t_{i - 1} = int\\
z_{app, i - 1} + 2p + (app), &amp; \text{if } t_{i - 1} = app \wedge r(j) \leq p\\
z_{app, i - 1} + r(j) + (app), &amp; \text{if } t_{i - 1} = app \wedge r(j) &gt; p
\end{cases}
$

$
z_{int, i} = min
\begin{cases}
z_{int, i - 1} + p + (int), &amp; \text{if } t_{i - 1} = int\\
z_{app, i - 1} + 2p + (int), &amp; \text{if } t_{i - 1} = app \wedge r(j) \leq p
\end{cases}
$

Note that that $t_{i - 1} = int$ dictates the use of $z_{int, i - 1}$ which is the optimal value of the previous stage when (int) was used. The case when $t_{i - 1} = app$ is faced similarly by using $z_{app, i - 1}$. We have represented the optimal values of each stage using mutual recursion. Equivalently you can use the following recursion:

$
z_{app, i} = (app) + min
\begin{cases}
z_{int, i - 1} + p, &amp; \text{if } t_{i - 1} = int\\
z_{app, i - 1} + 2p, &amp; \text{if } t_{i - 1} = app \wedge r(j) \leq p\\
z_{app, i - 1} + r(j), &amp; \text{if } t_{i - 1} = app \wedge r(j) &gt; p
\end{cases}
$

$
z_{int, i} = (int) + min
\begin{cases}
z_{int, i - 1} + p, &amp; \text{if } t_{i - 1} = int\\
z_{app, i - 1} + 2p, &amp; \text{if } t_{i - 1} = app \wedge r(j) \leq p
\end{cases}
$

This way the dynamic programming calculations will speed up by a constant factor.