eolymp
bolt
Try our new interface for solving problems
Problems

A dangerous game

A dangerous game

Alex got into serious trouble. He owes to the Mafia N dollars, and the time of reckoning has almost come. Alex is well known about the dangers of late return of the debt, so he wants to collect N dollars at any cost. However, at the moment he has only M dollars. Alex’s buddy, who learned about the problems suggested a game --- but this time for money. Alex has K attempts to bet any amount from zero to the amount that he has a --- not necessarily even a whole number. With probability of P \% Alex gets bet double in volume, otherwise gets nothing. Alex does not care of how much money will remain, most importantly, to have N dollars to pay off. Alex, of course, trying to play good as he can. Find out what a chances that Alex will return his debt. \textbf{Limit} 0 \textit{≤ N ≤ }10^9 0 \textit{≤ M ≤ }10^9 1 \textit{≤ K ≤ }12 0 \textit{≤ P ≤ }100 \InputFile The single line contains four integers: N, M, K and P . \OutputFile You should print a single number --- probability to collect enough money. Print the answer with an absolute error of not more than 10 ^7.
Time limit 1 second
Memory limit 256 MiB
Input example #1
1000000 750000 1 10
Output example #1
0.100000000
Author Евгений Капун
Source Зимняя школа по программированию 2014, Харьков