Convert all animals into a common unit.
Given:
(3)horses(=5)cows
1 horse=35 cows
(6)cows(=10)sheep
1 sheep=106=53 cows
Now calculate consumption in cow-units × months.
A's usage
21 horses for 6 months
21×35=35 cow-units
For 6 months:
35×6=210
15 cows for 2 months
15×2=30
Total for A:
210+30=240
B's usage
15 cows for 6 months
15×6=90
40 sheep for 7.5 months
Each sheep (=\frac35) cow.
40×53=24 cow-units
For (7.5) months:
24×7.5=180
Total for B:
90+180=270
Ratio of rent:
A:B = 240:270 = 8:9
Total parts:
8+9=17
Therefore, A should pay:
178
of the total rent.