Please do it in c++ as soon as possible. Small boy Bubbles likes going through hours before his PC playing PC games. His #1 game is Bubble Strike, fast air pocket shooting web game for two players. Each game is set in one of the N maps, each having assorted scene arrangement. First time of each game chooses which map the game will be played. The game system subjectively picks three aides and shows them to the players. Each player should pick
Please do it in c++ as soon as possible.
Small boy Bubbles likes going through hours before his PC playing PC games. His #1 game is Bubble Strike, fast air pocket shooting web game for two players. Each game is set in one of the N maps, each having assorted scene arrangement. First time of each game chooses which map the game will be played. The game system subjectively picks three aides and shows them to the players. Each player should pick one of those three advisers for be discarded. The game system then, self-assertively picks one of the aides that were not picked by any of the players and starts the game.
He is significantly enthusiastic concerning the game and needs to contribute some energy focusing on maps, thusly growing freedoms to rule matches played on those aides. Regardless, he in like manner needs to finish his work, so he doesn't have the chance to focus on all of the aides. That is simply the explanation he asked the going with request: "What is the base number of guides I need to ponder, so the probability to play one of those aides is basically P"?
Would you have the option to help Johnny with finding the reaction for this request? You can acknowledge that Johnny's enemies don't have any associate with him, and they will indiscriminately pick maps.
Information: The essential line contains two entire numbers N (3 ≤ N ≤ 103) and P (0 ≤ P ≤ 1) – complete number of guides in the game and probability to play map Johnny has thought of. P will have everything thought about four digits after the decimal point.
Output:Yield contains one entire number – least number of guides Johnny needs to examine
Step by step
Solved in 4 steps with 1 images