Suppose number of atoms Y in ccp =n
As number of octahedral voids = No. of atoms in ccp : No of cotahedral voids = n
As alll the octahedral voids ar occupied by atoms X , therefore, number of atoms X = n .
Ratio of X :Y = n: n = 1:1.
Hence the formula of the compound is XY.