| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 8 | 6 | 6 | 85.714% |
There is a coin tossing tournament organized by the Thieves Guild. A total of $x$ thieves and $y$ assassins are going to take part in the tournament. Initially, each participant has a position denoted by an integer from 1ドル$ to $x + y$. The games happen while there are at least two participants. In each game, consider participant $A$ standing at the position with the greatest number. Let it be position $k$. Participant $A$ tosses a fair coin, hoping to move to position $\lfloor k / 2 \rfloor$ which is occupied by some participant $B$ at the moment. If $A$ got heads, then $A$ moves to $B$'s position, and $B$ is kicked out of the tournament. If $A$ got tails, then $A$ is kicked out of the tournament, and $B$ remains at the same position. The last remaining participant is the winner.
Делегация ассассинов опоздала к регистрации, так что воры заняли позиции от 1ドル$ до $x,ドル и ассассинам остались позиции от $x + 1$ до $x + y$. Казначей турнира хочет заранее знать, какова вероятность победы ассассина на турнире, если во всех играх используется идеальная монетка, то есть вероятности выпадения <<орла>> и <<решки>> равны 1ドル / 2$ и не зависят друг от друга. Найдите эту вероятность.
The delegation of assassins was late for the registration, so the thieves already occupied the positions from 1ドル$ to $x,ドル and the assassins were left with the positions from $x + 1$ to $x + y$. The tournament treasurer wants to know in advance what is the probability of an assassin winning the tournament, given that a fair coin is used for every game, that is, the probabilities of heads and tails are equal to 1ドル / 2,ドル and all coin tosses are independent. Find this probability.
The first line contains two integers $x$ and $y$: the number of thieves and the number of assassins (1ドル \le x, y \le 1,000円,000円$).
Output the required probability as a decimal fraction. Your answer will be considered correct if the absolute or relative error will be less than 10ドル^{-6}$.
1 1
0.5
5 3
0.312500000000