#include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) { cout << #a << " = " << a << endl; } template inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } typedef long long ll; int P0, Q; map, double> memo; double solve(int P, int depth = 0) { if(depth > 1e4) return 1.0f; if(memo.find({P, depth}) != memo.end()) return memo[{P, depth}]; auto& ret = memo[{P, depth}]; return ret = P / 200.0 + (100 - P) / 300.0 + P / 200.0 * solve(max(0, P-Q), depth + 1) + (100 - P) / 300.0 * solve(min(100, P+Q), depth + 1); } int main() { cin >> P0 >> Q; printf("%.10f\n", (1 + solve(P0)) / 3); return 0; }