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;
const int INF = 1000000001;
const double EPS = 10e-12;
double dp[210][260][2][265];
int x, k, p;
int zero[300];
int calczero(int a) {
  int ans = 0;
  while (!(a & 1) && a) {
    ++ans;
    a >>= 1;
  }
  return ans;
}
int main() {
  cin >> x >> k >> p;
  cout.precision(10);
  for (int i = 0; i < (260); ++i) zero[i] = calczero(i);
  double pmul = (1.0 * p) / 100;
  double padd = 1 - pmul;
  double pr;
  string s = "";
  while (x) {
    s = s + (char)((x % 2) + '0');
    x /= 2;
  }
  int mask = 0;
  for (int i = min(7, ((int)(s).size()) - 1); i >= (0); --i)
    mask = mask * 2 + (s[i] - '0');
  int last, len;
  len = 0;
  last = '0';
  if (((int)(s).size()) > 8) {
    last = s[8];
    len = 1;
  }
  for (int i = 9; i < ((int)(s).size()) && s[i] == s[i - 1]; ++i) ++len;
  dp[0][mask][last - '0'][len] = 1;
  for (int i = 0; i <= (k - 1); ++i)
    for (int mask = 0; mask <= (255); ++mask)
      for (int len = 0; len <= (250); ++len)
        for (int last = 0; last <= (1); ++last) {
          if ((dp[i][mask][last][len]) < EPS) continue;
          pr = dp[i][mask][last][len] * padd;
          if (mask == 255) {
            if (len == 0)
              dp[i + 1][0][1][1] += pr;
            else {
              if (last == 0)
                dp[i + 1][0][1][1] += pr;
              else
                dp[i + 1][0][0][len] += pr;
            }
          } else {
            dp[i + 1][mask + 1][last][len] += pr;
          }
          pr = dp[i][mask][last][len] * pmul;
          int lastinmask = mask >> 7;
          if (len == 0) {
            if (lastinmask == 1)
              dp[i + 1][(mask << 1) % 256][1][1] += pr;
            else
              dp[i + 1][(mask << 1) % 256][0][0] += pr;
          } else {
            if (lastinmask == last)
              dp[i + 1][(mask << 1) % 256][last][len + 1] += pr;
            else
              dp[i + 1][(mask << 1) % 256][1 - last][1] += pr;
          }
        }
  double ans = 0;
  for (int mask = 0; mask <= (255); ++mask)
    for (int len = 0; len <= (250); ++len)
      for (int last = 0; last <= (1); ++last) {
        if (dp[k][mask][last][len] < EPS) continue;
        pr = dp[k][mask][last][len];
        if (mask == 0)
          if (last == 0)
            ans += pr * (8 + len);
          else
            ans += pr * 8;
        else {
          ans += pr * zero[mask];
        }
      }
  cout << ans;
  return 0;
}