Problem: 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 ≤ 109; 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.

Examples

Input

1 1 50


Output

1.0000000000000


Input

5 3 0


Output

3.0000000000000


Input

5 3 25


Output

1.9218750000000

Note

If the concept of expected value is new to you, you can read about it by the link: 

http://en.wikipedia.org/wiki/Expected_value

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int x, k, p;
  cin >> x >> k >> p;
  int startmask = 0;
  for (int i = 0; i <= 8; ++i)
    if ((x & (1 << i)) > 0) startmask |= (1 << i);
  int startbit;
  if ((x & (1 << 9)) > 0)
    startbit = 1;
  else
    startbit = 0;
  int startile = 0;
  if (x < (1 << 9))
    startile = 1;
  else {
    if (startbit == 0)
      for (int i = 9; (x & (1 << i)) == 0; ++i) ++startile;
    else
      for (int i = 9; (x & (1 << i)) > 0; ++i) ++startile;
  }
  double P = p / 100.0;
  double dp[2][1 << 9][2][230];
  for (int mask = 0; mask < (1 << 9); ++mask)
    for (int bit = 0; bit < 2; ++bit)
      for (int ile = 1; ile < 230; ++ile) dp[0][mask][bit][ile] = 0.0;
  dp[0][startmask][startbit][startile] = 1.0;
  for (int i = 0; i < k; ++i) {
    int nr = i % 2;
    for (int mask = 0; mask < (1 << 9); ++mask)
      for (int bit = 0; bit < 2; ++bit)
        for (int ile = 1; ile < 230; ++ile) dp[nr ^ 1][mask][bit][ile] = 0.0;
    for (int mask = 0; mask < (1 << 9); ++mask) {
      for (int bit = 0; bit < 2; ++bit) {
        for (int ile = 1; ile < 230; ++ile) {
          int ostbit;
          if ((mask & (1 << 8)) == 0)
            ostbit = 0;
          else
            ostbit = 1;
          int przes = mask << 1;
          if ((przes & (1 << 9)) > 0) przes -= (1 << 9);
          if (ostbit == bit)
            dp[nr ^ 1][przes][bit][ile + 1] += dp[nr][mask][bit][ile] * P;
          else
            dp[nr ^ 1][przes][bit ^ 1][1] += dp[nr][mask][bit][ile] * P;
          if (mask + 1 < (1 << 9))
            dp[nr ^ 1][mask + 1][bit][ile] +=
                dp[nr][mask][bit][ile] * (1.0 - P);
          else {
            if (bit == 1)
              dp[nr ^ 1][0][0][ile] += dp[nr][mask][bit][ile] * (1.0 - P);
            else
              dp[nr ^ 1][0][1][1] += dp[nr][mask][bit][ile] * (1.0 - P);
          }
        }
      }
    }
  }
  double odp = 0.0;
  for (int mask = 0; mask < (1 << 9); ++mask) {
    for (int bit = 0; bit < 2; ++bit) {
      for (int ile = 1; ile < 230; ++ile) {
        int zera = 0, t = mask, nr = k % 2;
        while (zera < 9 && t % 2 == 0) {
          t /= 2;
          ++zera;
        }
        if (t == 0 && bit == 0) zera += ile;
        odp += zera * dp[nr][mask][bit][ile];
      }
    }
  }
  cout << fixed << setprecision(10);
  cout << odp;
  return 0;
}