Let $(Z_t)_{0\leq t\leq T}$ be a stochastic process. Then $Z_T$ is a r.v. and $F_{Z_T}$ a corresponding cdf.
Suppose $\mathbb{E}[|e^{Z_t}|]<\infty$ for all $t\geq0$. Also \begin{equation} \mathbb{E}\big[e^{Z_t} | \mathcal{F}_s\big]=1=e^{Z_0} \quad\forall 0\leq s\leq t \end{equation}
(i.e. $(e^{Z_t})_{t\geq0}$ is a martingale) and thus \begin{equation} \int_{\mathbb{R}}^{}e^zdF_{Z_T}(z)=1 \end{equation}
Consider the problem:
\begin{equation} \max_{F_{Z_T}}\int_{lnK}^{\infty}(e^z-K)dF_{Z_T}(z) \end{equation}
subject to \begin{equation} \int_{\mathbb{R}}^{}z^2dF_{Z_T}(z)\leq Q \end{equation}
where $Q\in\mathbb{R}^+$ is some fixed constant.
I thought of Euler - Lagrange approach from Calculus of Variations but I am not sure if that will work since there is no information whether $F$ is differentiable or even continuous ($Z_T$ may be discrete r.v.)
I would be grateful for a hint on how these kind of problems should be approached.