optimal parimutuel betting strategy Question

Four teams $A,B,C$ and $D$ have respective probabilities $\frac{11}{135},\frac{64}{135},\frac{7}{27},\frac{5}{27}$ of becoming champion. Three individuals $X,Y,Z$ have \$$100$ each to bet on the different teams and the payout system is that of parimutuel betting, i.e. whoever has bet on the winning team will win the entire pot, with the pot paid out in pro-rata fashion. So if $X$ and $Y$ have both bet \$$20$ on the winner and $Z$ did not bet on the winner, $X$ and $Y$ will each receive \$$150$ and $Z$ receives nothing. Suppose $X$ and $Y$ have respectively allocated their money as follows:
$A: \$0 \text{ and } \$0 $, $B: \$35 \text{ and } \$50 $, $C: \$35 \text{ and } \$50 $, $D: \$30 \text{ and } \$0$.
What is the optimal amount for $Z$ to bet on each team? Amounts can only be integers and $Z$ must bet the entire $100.

Attempt
In the case of $A$ being champion, a stake of \$$1$ will guarantee $Z$ wins the entire pot. For each of the other outcomes, the expected winnings of $Z$ will be
$$ p \left[\left(\dfrac{300}{R+z}\right)z - z\right] - (1-p)z$$
where $p$ is the probability of that outcome, $R$ is the amount $X$ and $Y$ have collectively bet on this outcome and $z>0$ is the amount $Z$ bets. This simplifies to
$$\dfrac{300pz}{R+z} - z$$
then differentiating and setting the gradient to zero gives a maximiser $z = -R + \sqrt{300Rp}$. However evaluating these, the amounts sum to well below \$$100$ and are not integers. I also tried it assuming a Kelly betting criterion i.e. find $z$ such that
$$\frac{z}{100} = p - \dfrac{1-p}{\frac{300}{R+z}-1}$$
and had the same issues. How does one find an optimal solution and what are the underlying principles in approaching this question?
 A: Winning probabilities of teams A, B, C and D are respectively $ \displaystyle \small \frac{11}{135},\frac{64}{135},\frac{35}{135},\frac{25}{135}$.
As your rightly said it makes sense for Z to bet $ \$1$ on team A and bet rest of $ \$ 99$ on other $3$ teams. So Z's expected winning is,
$\displaystyle \small z = \frac{11}{135} \times 300 + \frac{64}{135} \times 300 \times \frac{b}{85+b} + \frac{35}{135} \times 300 \times \frac{c}{85+c} + \frac{25}{135} \times 300 \times \frac{d}{30+d}$
$ \displaystyle \small = \frac{300}{135} \big(11 + \frac{64b}{85+b} + \frac{35c}{85+c} + \frac{25d}{30+d} \big)$
where $ \small  \ b + c + d = 99, (b, c, d) \in \mathbb{N^0}$. Now I do not see an easy way out here. One way will be to ignore integer constraint at first, apply Lagrange Multipliers method, obtain possible solutions and then check nearest points with integer values. Ignoring the integer constraint, when I plug this into WolframAlpha, it gives me maximum of $ \displaystyle \small 11 + \frac{64b}{85+b} + \frac{35c}{85+c} + \frac{25d}{30+d} \approx 53.936$  at point $ \small (b, c, d) \approx (56.6514, 19.7526, 22.5959)$.
That is expected winning of $ \small \approx \$119.86$ (a gain of $\small \approx \$ 19.86$).
But as $b, c, d$ must be integers, we may have to check nearest points with integer values.
A: You don't want to maximize the return of one bet, you want to maximize the expected return of the three bets together.  Define $z_B$ as the amount $Z$ bets on $B$ and $z_C,z_D$ likewise.  The expected return is
$$\dfrac{300p_Bz_B}{R+z_B} - z_B+\dfrac{300p_Cz_C}{R+z_C} - z_C+\dfrac{300p_Dz_D}{R+z_D} - z_D$$
subject to $z_B+z_C+z_D=99$.  As the three subtractions sum to a constant, you can ignore them.
