Theformulashouldbeneutral.
Itmeans−
totalcationcharge=totalanioniccharge
2+5=2x
x=72
The formula becomes
XYZ72
Simplifying it-
Final formula becomes- X2Y2Z7