Ok, we don't know if anyone is in there, maybe they all went grocery shopping in that scenario, you are the only one (I hope) and therefor answer is 2 legs
if everybody is in ther (including yourself)
king=1 queens=5 how many rooms total? 5 times 5=25 rooms 5 big cats per room 5 times 25=125 big cats each big cat has 5 little cats 125 times 5=625 little cats
1 king 5 queens 125 big cats 625 little cats
people has 2 legs casts have 4 1*2+5*2+125*4+625*4=3012 legs plus yourself (2 legs) 3014 legs
2 answers 1. you are alone in pallace, quesiton never mentioned that the king and co were in the pallace, only yourself, therfor answer is 2 legs (yours) 2. everybody is in there including yourself, and answer is 3014 legs