Since, atoms of Y forms CCP (cubic close packing) which is analogous to FCC (face centered cubic)
So, effective number of atoms of Y in lattice =4
Number of octahedral voids = Number of atoms forming CCP =4
So, effective number of atoms of X in the lattice =4
Now, X:Y⇒X:Y
4:4 1:1
So, the formula of the compound is XY