#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, k;
	cin >> n >> k;

	double dp1[n+1][6*n+1], dp2[n+1][6*n+1];
	rep(i, n+1) rep(j, 6*n+1) {
		dp1[i][j] = 0.0;
		dp2[i][j] = 0.0;
	}

	dp1[0][0] = 1.0;
	dp2[0][0] = 1.0;
	rep(i, n) rep(j, 6*n+1){
		for(int l = 1; l <= 6; l++){
			if(j+l <= 6*n) dp1[i+1][j+l] += dp1[i][j] / 6.0;
		}

		if(i+1 <= k){
			for(int l = 4; l <= 6; l++){
				if(j+l <= 6*n) dp2[i+1][j+l] += 2.0 * dp2[i][j] / 6.0;
			}
		}else{
			for(int l = 1; l <= 6; l++){
				if(j+l <= 6*n) dp2[i+1][j+l] += dp2[i][j] / 6.0;
			}
		}
	}

	double ans = 0.0;
	rep(i, 6*n+1){
		for(int j = i + 1; j <= 6*n; j++) ans += dp1[n][i] * dp2[n][j];
	}
	
	cout << fixed << setprecision(10);
	cout << ans << endl;
}