No. of atoms in a ccp unit cell=4
B is in ccp so B=4Cation A are equally distributed between octahedral and tetrahedral voids and all octahedral voids are occupied-i.e in ccp octahedral voids =4 since octahedral and tetrahedral are equal that means-
Tetrahedral voids =4 so,
A=4 tetrahedral+4 octahedral
A=8
Therefore Formula is-
A8B4 or A2B