eolymp
bolt
Try our new interface for solving problems

Game

Alice and Bob play the next game. First, they collect \textbf{N} small stones and put them in one pile. Then they take turns, beginning with Alice, throw a coin. If a player rolls an eagle, it takes a heap of stone, if tails, then do not take it. The winner is the one who takes the last stone. Known ability of players to throw the correct side of a coin. More precisely, if Alice wants to throw his way toward a coin, then it throws it aside with a probability \textbf{P}. Same probability for Bob is \textbf{Q}. Required to find the probability with which Alice will win the game, provided that both players will play optimally. \InputFile The first line contains one integer \textbf{N} (\textbf{1} <= \textbf{N} <= \textbf{99 999 999}). Second line set \textbf{P}, in the third \textbf{Q} (\textbf{0.5} <= \textbf{P}, \textbf{Q} <= \textbf{0.999 999 99}). The probabilities are given no more than eight characters after the comma. \OutputFile Bring one real number - the probability with which Alice will win the game. A display with an accuracy of \textbf{8} decimal places.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
0.5
0.5
Output example #1
0.66666667
Author Pavel Kuznecov