#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-12; int main() { int n, k; cin >> n >> k; int v[2][6] = {{1,2,3,4,5,6},{4,4,5,5,6,6}}; double dp[11][61] = {}; dp[0][0] = 1.0; REP(i, n) { int p; if (i < n - k) p = 0; else p = 1; REP(j, 61) REP(k, 6) if (j + v[p][k] <= 60) dp[i + 1][j + v[p][k]] += dp[i][j] / 6.0; } int cnt[11][61] = {}; cnt[0][0] = 1; REP(i, n) REP(j, 61) REP(k, 6) if (j + v[0][k] <= 60) cnt[i + 1][j + v[0][k]] += cnt[i][j]; double ans = 0; REP(i, 61) { if (cnt[n][i] == 0) continue; double now = 0; FOR(j, i + 1, 61) now += dp[n][j]; now *= cnt[n][i]; ans += now; } ans /= pow(6, n); printf("%.15f\n", ans); return 0; }