#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 dp1[11][61] = {}; dp1[0][0] = 1.0; REP(i, n) { int p = i >= n - k; REP(j, 61) REP(k, 6) if (j + v[p][k] <= 60) dp1[i + 1][j + v[p][k]] += dp1[i][j] / 6.0; } double dp2[11][61] = {}; dp2[0][0] = 1; REP(i, n) REP(j, 61) REP(k, 6) if (j + v[0][k] <= 60) dp2[i + 1][j + v[0][k]] += dp2[i][j] / 6.0; double ans = 0; REP(i, 61) FOR(j, i + 1, 61) ans += dp2[n][i] * dp1[n][j]; printf("%.15f\n", ans); return 0; }