#include #include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max() / 32 * 15 + 208; int main() { int p, q; cin >> p >> q; double ans = 1.0/3; array v{}, v2{}; v[p] = 1.0/3; for (int i = 0; i < 100; ++i) { fill(v2.begin(),v2.end(), 0.0); for (int j = 0; j <= 100; ++j) { v2[max(0, j-q)] += v[j]*j/200; ans += v[j]*j/200; v2[min(100, j+q)] += v[j]*(100-j)/300; ans += v[j]*(100-j)/300; } v = v2; } printf("%.10lf\n", ans); return 0; }