#include using namespace std; using ll = long long; using vd = vector; using vvd = vector; #define REP(i,n) for(ll i=0; i<(n); ++i) #define FOR(i,b,n) for(ll i=(b); i<(n); ++i) int main() { cout << fixed << setprecision(30); ll n, k; cin >> n >> k; vvd dp1(11, vd(61, 0)); vvd dp2(11, vd(61, 0)); dp1[0][0] = dp2[0][0] = 1; REP(i, n) REP(j,61){ FOR(l, 1, 7) if(j + l < 61) dp1[i + 1][j + l] += dp1[i][j] / 6; if (k > i) { FOR(l, 4, 7) if (j + l < 61) dp2[i + 1][j + l] += dp2[i][j] / 3; } else { FOR(l, 1, 7) if (j + l < 61) dp2[i + 1][j + l] += dp2[i][j] / 6; } } double ans = 0; FOR(i, 1, 61) for (ll j = i-1; j >= 0; --j) ans += dp2[n][i] * dp1[n][j]; cout << ans << endl; return 0; }