Explaination
If a single cook can bake 5 large cakes per hour and the kitchen is available for 3 hours, a single cook can bake 5 x 3 = 15 large cakes during that time. 29 large cakes are needed for the party so 29/15 = 1 and 14/15 cooks are needed to bake the required number of large cakes.
If a single cook can bake 14 small cakes per hour and the kitchen is available for 3 hours, a single cook can bake 14 x 3 = 42 small cakes during that time. 260 small cakes are needed for the party so 260/42 = 6 and 4/21 cooks are needed to bake the required number of small cakes.
Because you can't employ a fractional cook, round the number of cooks needed for each type of cake up to the next whole number resulting in 2 + 7 = 9 cooks.