Question 1195948
Not clear, "24 gifts".  Is this supposed to be total of the number of sheep and hives ?


h, hives
x, sheep
{{{system(50x+35h=990,x+h=24)}}}
If this makes good sense, then just simplify and solve.


A possible path:
{{{system((1/5)(50x+35h)=(1/5)(990),x+h=24)}}}


{{{system(10x+7h=198,x+h=24)}}}


{{{system(10x+7h=198,7x+7h=168)}}}----------------YOU FINISH!!