Comments

Mine is around 1240 days

Screenshot-2024-04-28-131429

+1

Thanks for the explanation. I understood it now!

Yes, but if he loses first 3 times, as x is 3, won't he bet all his coins for this round.

  • Bet 1 coin — lost
  • Bet 1 coin — lost
  • Bet 1 coin — lost
  • Bet all 3 remaining coins, as x is 3, so total coins now, 6 — 1 — 1 — 1 — 3 + (3*3) = 9

How this works for the test-case 3 3 6?

Sasha can bet just 1 coin in each round:

  • 1 coin — lost

  • 1 coin — win; receives 3 coins, total coins = 6 — 1 — 1 + 3 = 7

And so on... Any amount can be created with just 1-1 coin bets!