#include using namespace std; #define DUMP(x) cerr << #x << "=" << x << endl #define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("< >(x) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define REP(i,m,n) for (int i=m;i<(int)(n);i++) #define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h)) #define ALL(a) (a).begin(),(a).end() typedef long long ll; const int INF = 1e9; const ll INFLL = 1e18; typedef pair PII; int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1}; double p0, q; double dfs(int n, double p) { double res = 0.0; if (n == 20) return res; res += 0.5 * p; // win res += 1 / 3.0 * (1.0 - p); // win res += 0.5 * p * dfs(n + 1, max(0.0, p - q)); //draw res += 1 / 3.0 * (1.0 - p) * dfs(n + 1, min(1.0, p + q)); //draw return res; } int main() { ios::sync_with_stdio(false); cin >> p0 >> q; p0 /= 100, q /= 100; cout << fixed << setprecision(10); cout << 1/3.0 * (1.0 + dfs(1, p0)) << endl; }