#include "bits/stdc++.h"
#define REP(i,n,N) for(int i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll inf=1e18;

int N,K;
double dp[11][100];
double dp2[11][100];
int main(){
    cin>>N>>K;
    dp[0][0]=1.0;
    dp2[0][0]=1.0;
    REP(i,0,N){
        RREP(j,0,70){
            if(i<K){
                REP(k,4,6+1) dp[i+1][j+k] += dp[i][j]/3;
            }else{
                REP(k,1,6+1) dp[i+1][j+k] += dp[i][j]/6;
            }
            REP(k,1,6+1){
                dp2[i+1][j+k] += dp2[i][j]/6;
            }
        }

    }
    double ans=0;
    REP(j,0,70){
        REP(i,0,j) {
            ans+=dp[N][j]*dp2[N][i];
        }
    }
    printf("%.4lf",ans);
    return 0;
}