Let M be the midpoint of AB. Both compass crossings lie on its perpendicular bisector, on opposite sides of AB. Half the segment is 7 cm, and AX is a 25 cm radius. Pythagoras in right triangle AMX gives
MX2MX2MX=252−72=576=24 cm.
The same calculation in triangle AMY gives a midpoint-to-crossing distance of 24 cm on the other side of AB. Add the two parts.
XYXY=24+24=48 cm.