#include #include #include using namespace std; int main(){ int n,x;cin>>n>>x; vector> A(n+1,vector(6*n+1)); A[0][0] = 1; for(int i = 0; n > i; i++){ for(int j = 0; 6*i >= j; j++){ for(int k = 1; 6 >= k; k++){ A[i+1][j+k] += A[i][j]/6; } } } vector> B(n+1,vector(6*n+1)); B[0][0] = 1; for(int i = 0; n > i; i++){ for(int j = 0; 6*i >= j; j++){ for(int k = 1; 6 >= k; k++){ if(j < x){ if(k <= 3)continue; else B[i+1][j+k] += B[i][j]/3; }else{ B[i+1][j+k] += B[i][j]/6; } } } } double ans = 0; for(int i = 0; 6*n >= i; i++){ for(int j = i+1; 6*n >= j; j++){ ans += A[n][i]*B[n][j]; } } cout << fixed << setprecision(10) << ans << endl; }