Given ratio is
Spiders : Chicken : dogs : : 4 : 2 : 1
Ratio of thier corresponding legs
4*8 : 2*2 : 1*4
=32 : 4 : 4
=8 : 1 : 1
Now to find contribution of legs from the spiders, chickens and dogs.
8x + x + x = 10x = 680
x = 68
Therefore the contribution of leg count from the three are as follows
68*8 : 68 : 68
Since we need the ratio of the count of heads and not the legs dividing the ratio appropriately with the number of legs each have
68*8/8 : 68/2 : 68/4
= 68 : 34 : 17
ie., Spiders = 68, Chickens = 34 & Dogs = 17.