Solution (source code)

= Solution

With $G=-U=e^{-x}$ and $F=-V$, maximization becomes
$$
\boxed{F(n,x)=\inf_{c,h}\{G(c)+E[F(n+1,x-c+hR)]\},\quad F(N,x)=e^{-x}.}
$$