Codeforces Round 252 (Div. 2)
翻译中…
Valera is a coder. Recently he wrote a funny program. The pseudo code for this program is given below:
翻译中…
//input: integers x, k, p
a = x;
for(step = 1; step <= k; step = step + 1){
rnd = [random integer from 1 to 100];
if(rnd <= p)
a = a * 2;
else
a = a + 1;
}
s = 0;
while(remainder after dividing a by 2 equals 0){
a = a / 2;
s = s + 1;
}
翻译中…
Now Valera wonders: given the values $*x*$, $*k*$ and $*p*$, what is the expected value of the resulting number $*s*$?
翻译中…
Input
翻译中…
The first line of the input contains three integers $*x*, *k*, *p*$ ($1 ≤ *x* ≤ 10^{9}; 1 ≤ *k* ≤ 200; 0 ≤ *p* ≤ 100$).
翻译中…
Output
翻译中…
Print the required expected value. Your answer will be considered correct if the absolute or relative error doesn't exceed $10^{ - 6}$.
翻译中…
Note
翻译中…
If the concept of expected value is new to you, you can read about it by the link:
翻译中…
样例
Input #1
1 1 50
Output #1
1.0000000000000
InputCopy
OutputCopy
Input #2
5 3 0
Output #2
3.0000000000000
InputCopy
OutputCopy
Input #3
5 3 25
Output #3
1.9218750000000
InputCopy
OutputCopy
题目信息
标签
位运算
动态规划
数学
概率论
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。