Let, a,b be the legs of the triangle and c be its hypotenuse
For a right triangle, the hypotenuse is the diameter of the circum circle. Hence
c=2R=30
Also, we know that the sum up legs of a right angled triangle is double the sum of the radii of the circum circle and the in circle.
Thus a+b=2(R+r)=42⟹b=42−a
By pythogoras theorem, we have, a2+b2=c2=900
⟹a2+(42−a)2=900
⟹a2−42a+432=0
Solving this we get, a=24,18
Thus the sides of the right triangle are 18,24 and 30.