Assume the edges of three cubes (in cm) be $3x$, $4x$ and $5x$ respectively.
Then, the volume of the cube after melting will be $={{\left( 3x \right)}^{3}}+{{\left( 4x \right)}^{3}}+{{\left( 5x \right)}^{3}}$
$=9{{x}^{3}}+64{{x}^{3}}+125{{x}^{3}}=216{{x}^{3}}$
Now, assume a be the edge of the new cube so formed after melting
Now we have,
${{a}^{3}}=216{{x}^{3}}$
$a=6x$
As we know that,
Diagonal of the cube $=\sqrt{\left( {{a}^{2}}+{{a}^{2}}+{{a}^{2}} \right)}=a\sqrt{3}$
$12\sqrt{3}=a\sqrt{3}$
$a=12cm$
$x=12/6=2$
Thus, the edges of the three cubes are $6cm$, $8cm$ and $10cm$ respectively.