Is it a math problem? If so, this question is not rigorous. Where are the coins? Is there such a probability? Theoretically, it's possible every time.
If you are a primary school student, if you give the cake to Party A and Party B now, no matter the final score is 10. Distribute cakes to them according to their scores. therefore
A should get: 9/(9+8)=9/ 17, which is 9/ 17 when A gets the cake.
B should get: 8/(9+8)=8/ 17, which is 8/ 17 when B gets the cake.