Thimbles
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In the game "3 Thimbles," the probability of correctly guessing the thimble hiding the seed is 0.4. Each correct guess earns the player 2 lars, while each incorrect guess results in a loss of 1 lar.
Your task is to calculate the probability that the player will run out of funds, starting with an initial amount of N lars. Once the player's funds are depleted, they can no longer continue playing.
Input
The input consists of a single line containing an integer N (0 ≤ N ≤ 50), representing the initial amount of lars the player has.
Output
Output a single line with the probability that the player will run out of funds, rounded to seven decimal places.
Examples
Input #1
Answer #1
Submissions 48
Acceptance rate 23%