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;
double memo[204][(1 << 8)][2][250];
int lastEightBits(int x) {
  int ret = 0;
  return x % 256;
}
int ctCon(int num, int on, int con) {
  if (num == 0) {
    if (con == 0)
      return 0;
    else if (on == 1)
      return 8;
    else {
      return 8 + con;
    }
  } else {
    int ret = 0;
    for (int i = 0; i < 8; i++) {
      if ((num & (1 << i)) == 0) {
        ret++;
      } else
        break;
    }
    return ret;
  }
}
int main(void) {
  int x, k, p;
  scanf("%d", &x);
  scanf("%d", &k);
  scanf("%d", &p);
  for (int i = 0; i <= k; i++)
    for (int j = 0; j < 256; j++)
      for (int l = 0; l < 2; l++)
        for (int m = 0; m < 250; m++) memo[i][j][l][m] = -1.0;
  int cur = lastEightBits(x);
  int on = ((x & (1 << 8)) != 0);
  int consecutive = 0;
  if (x > 255) {
    int ct = 8;
    while (x >= (1 << ct)) {
      if (on && (x & (1 << ct))) {
        consecutive++;
      } else if (!on && !(x & (1 << ct))) {
        consecutive++;
      } else
        break;
      ct++;
    }
  }
  assert(on <= 1);
  memo[0][cur][on][consecutive] = 1.0;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < 256; j++) {
      for (int l = 0; l < 2; l++) {
        for (int m = 0; m < 250; m++) {
          if (memo[i][j][l][m] <= 0.0) continue;
          int nxtnum, nxtEight, isOn, con;
          if (j == 255) {
            nxtEight = 0;
            if (l == 0) {
              isOn = 1;
              con = 1;
            } else {
              isOn = 0;
              con = m;
            }
            if (memo[i + 1][0][isOn][con] <= 0) {
              memo[i + 1][0][isOn][con] =
                  1.0 * (100 - p) / 100 * memo[i][j][l][m];
            } else {
              memo[i + 1][0][isOn][con] +=
                  1.0 * (100 - p) / 100 * memo[i][j][l][m];
            }
          } else {
            if (memo[i + 1][j + 1][l][m] <= 0.0)
              memo[i + 1][j + 1][l][m] =
                  1.0 * (100 - p) / 100 * memo[i][j][l][m];
            else {
              memo[i + 1][j + 1][l][m] +=
                  1.0 * (100 - p) / 100 * memo[i][j][l][m];
            }
          }
          nxtnum = (j << 1);
          nxtEight = lastEightBits(nxtnum);
          isOn = ((nxtnum & (1 << 8)) != 0);
          con = m;
          if (l == isOn) {
            if (con > 0) con = m + 1;
          } else {
            con = 1;
          }
          if (memo[i + 1][nxtEight][isOn][con] <= 0.0) {
            memo[i + 1][nxtEight][isOn][con] = 1.0 * p / 100 * memo[i][j][l][m];
          } else {
            memo[i + 1][nxtEight][isOn][con] +=
                1.0 * p / 100 * memo[i][j][l][m];
          }
        }
      }
    }
  }
  double ret = 0.0;
  for (int i = 0; i < 256; i++) {
    for (int j = 0; j < 2; j++) {
      for (int l = 0; l < 250; l++) {
        if (memo[k][i][j][l] > 0.0) {
          ret += memo[k][i][j][l] * ctCon(i, j, l);
        }
      }
    }
  }
  printf("%.10lf\n", ret);
  return 0;
}