Prisoners

Limits: 1s, 512 MB

Let me tell you a story of a dangerous prison. There were N prisoners in that prison. It is guaranteed that N is odd. Now each prisoner had a bounty bi set on his head. The warden of the prison was a very bad guy. He along with some of his friends (The Mafia Lords) had an idea of playing a game with the lives of the prisoners! The Game was simple; each day randomly two prisoners will be selected (who are alive!) and they will have to fight each other. They must fight until one dies and the sad part is the winning prisoner is also killed by the prison guards as the prison lords don’t want to see the same person fighting another day! The Game ends when there will be exactly one prisoner who will be left alive. The warden of the prison will set him free and will also give him money equivalent to his bounty as a reward. Now suppose you are one of the prisoners (Ahh sad for you) who wants to know what will be the expected bounty of the prisoner who will be alive at last i.e. when the game ends.


This is a companion discussion topic for the original entry at https://toph.co/p/prisoners