#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { lint n, K; cin >> n >> K; vector>> dp1(n + 1, vector>(K + 1, vector(70))); dp1[0][0][0] = 1; for (int i = 1; i <= n; i++) { for (int j = 0; j <= K; j++) { for (int k = 0; k < 70; k++) { if (i < j) { continue; } for (int l = 1; l <= 6; l++) { if (k - l >= 0) { dp1[i][j][k] += dp1[i - 1][j][k - l]; } } if (j > 0) { for (int l = 4; l <= 6; l++) { if (k - l >= 0) { dp1[i][j][k] += dp1[i - 1][j - 1][k - l]; } } } } } } vector> dp2(n + 1, vector(70)); dp2[0][0] = 1; for (int i = 1; i <= n; i++) { for (int j = 0; j < 70; j++) { for (int k = 1; k <= 6; k++) { if (j - k >= 0) { dp2[i][j] += dp2[i - 1][j - k]; } } } } lint all = powl(6LL, n * 2LL); lint cnt = 0; for (int taro = 0; taro < 70; taro++) { for (int jiro = 0; jiro < taro; jiro++) { cnt += dp1[n][K][taro] * dp2[n][jiro]; } } ld ans = (ld)cnt / (ld)all; cout << fixed << setprecision(10) << ans << endl; }