Since both triangles are similar triangles, you are able to find the scale factor through the perimeter.
Perimeter of the 3 4 5 triangle is 12cm.
Scale factor = 30/12
= 2.5
Multiply the scale factor with the 3 4 5 triangle.
3 x 2.5 = 7.5 cm
4 x 2.5 = 10 cm
5 x 2.5 = 12.5 cm
To summarize, all 3 new values should sum up to 30cm.