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?
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.