Casino "Three Devices for Lumbering" has come up with a new gambling game which has immediately received much attention.
The rules of this game are very easy. Two players alternate their turns in the game: a visitor and a croupier. At the start of the round, the croupier has a whole chocolate bar, and the visitor goes first.
In his turn, each player takes any of the pieces of chocolate which belong to the opponent, cuts it into two pieces so that the bigger piece is at most twice as large as the smaller. After that, he takes one of these two pieces for himself and leaves the other one.
The casino decides not to investigate any optimal strategies in this game. Instead, the croupier in his turn chooses one of the visitor's pieces with equal probability, and takes as much as possible: 32 of this piece. The randomness of the croupier's turns should convince the players that the croupier will make random and wrong turns.
The game lasts for a fixed odd number of turns: as the visitor starts without any chocolate at all, and croupier has a whole chocolate bar, it is guaranteed by the rules that the visitor makes the first and the last turns.
The cost of participation in one round is rather high: the player must pay 0.55 chocolate units, or c.u., which will not be refunded after the game. Despite this fact, analysts of a rival company have found a vulnerability in the rules which can guarantee making profit from each round of the game: get at least 0.55 of the chocolate piece in total in each round.
You have to develop such a strategy which gains at least 0.55 of the chocolate piece in total in each round, before the casino closes this vulnerability.
Let's take a look at what happens in the first sample. The participant must win in two rounds.
The first round:
At the end, the participant has 61+272+31≈0.574 which is bigger than 0.55: the participant wins the round.
The second round:
At the end, the participant has 92+818+92≈0.543 which is less than 0.55: the participant loses the round, and the interactor prints 0, which means that solution got "Wrong Answer" on this test.