#include #include #include #include using namespace std; int sum(int m, int n, int now) { if (n==now) return 3 * m + 1; else return sum(2 * m, n, now + 1) + sum(m + 1, n, now + 1) + sum(0, n, now + 1); } int main(void) { int m, n; cin >> m >> n; double ans = sum(m, n, 1) / pow(3.0, n); printf("%.8f\n", ans); return 0; }