import std.conv, std.functional, std.stdio, std.string; import std.algorithm, std.array, std.bigint, std.container, std.math, std.numeric, std.range, std.regex, std.typecons; import core.bitop; class EOFException : Throwable { this() { super("EOF"); } } string[] tokens; string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; } int readInt() { return readToken.to!int; } long readLong() { return readToken.to!long; } real readReal() { return readToken.to!real; } bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } } bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } } int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; } int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); } int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); } enum N = 101; int P0, Q; void main() { try { for (; ; ) { P0 = readInt(); Q = readInt(); /* x[i] = (i/100) (1/2 + (1/2) x[i-Q]) + (1 - i/100) (1/3 + (1/3) x[i+Q]) */ auto a = new real[][](N, N + 1); foreach (i; 0 .. N) { const p = i / 100.0L; a[i][] = 0.0; a[i][i] += 1.0; a[i][max(i - Q, 0)] -= p / 2.0; a[i][min(i + Q, N - 1)] -= (1.0 - p) / 3.0; a[i][N] += p / 2.0 + (1.0 - p) / 3.0; } foreach (h; 0 .. N) { foreach (i; h + 1 .. N) { if (abs(a[h][h]) < abs(a[i][h])) { swap(a[h], a[i]); } } assert(abs(a[h][h]) > 1e-10); foreach (j; h + 1 .. N + 1) { a[h][j] /= a[h][h]; } a[h][h] = 1.0; foreach (i; h + 1 .. N) { foreach (j; h + 1 .. N + 1) { a[i][j] -= a[i][h] * a[h][j]; } a[i][h] = 0.0; } } foreach_reverse (i; 0 .. N) { foreach (j; i + 1 .. N) { a[i][N] -= a[i][j] * a[j][N]; } } real ans = 0.0; ans += 1.0L / 3.0; ans += 1.0L / 3.0 * a[P0][N]; writefln("%.10f", ans); } } catch (EOFException e) { } }