Answer
Please see the work below.
Work Step by Step
We know that the energy stored in capacitor $C_1$
$U_1=\frac{1}{2}C_1V_1^2$
and energy stored in capacitor $C_2$ is $U_2=\frac{1}{2}C_2V_2^2$
Now $U_1+U_2=\frac{1}{2}C_1V_1^2+\frac{1}{2}C_2V_2^2$
$U_1+U_2=\frac{1}{2}C_1(\frac{Q}{C_1})^2+\frac{1}{2}C_2(\frac{Q}{C_2})^2$
This simplifies to:
$U_1+U_2=\frac{Q^2(C_2+C_1)}{2C_1C_2}$
The equivalent resistance of the entire circuit is given as
$\frac{1}{C_{eq}}=\frac{1}{C_1}+\frac{1}{C_2}$
The energy stored in the equivalent capacitance is given as
$U_{eq}=\frac{1}{2}C_{eq}V$
$U_{eq}=\frac{1}{2}C_{eq}(\frac{Q}{C_{eq}})^2$
$U_{eq}=\frac{1}{2}\frac{Q^2}{C_{eq}}$
$U_{eq}=\frac{1}{2}(\frac{1}{C_1}+\frac{1}{C_2})Q^2$
$U_{eq}=\frac{1}{2}\frac{Q^2(C_1+C_2)}{C_1C_2}$
We can see that from both methods, we obtain the same result and this is the required condition.