#include using namespace std; double p0, q; double rec(int depth, double p) { if(depth == 20) return (p); double ret1 = 0.5 * p * (1 + rec(depth + 1, max(0.0, p - q))); double ret2 = 1.0 / 3.0 * (1 - p) * (1 + rec(depth + 1, min(1.0, p + q))); return (ret1 + ret2); } int main() { cin >> p0 >> q; p0 /= 100; q /= 100; cout << fixed << setprecision(10) << 1.0 / 3.0 + 1.0 / 3.0 * rec(0, p0) << endl; }