#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(70)), dp2(n + 1, vector(70)); dp1[0][0] = 1; for (int i = 1; i <= n; i++) { for (int j = 0; j < 70; j++) { if (i <= K) { for (int k = 4; k <= 6; k++) { if (j - k >= 0) { dp1[i][j] += dp1[i - 1][j - k]; } } } else { for (int k = 1; k <= 6; k++) { if (j - k >= 0) { dp1[i][j] += dp1[i - 1][j - k]; } } } } } 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) * powl(3LL, K) * powl(6LL, n - K); lint cnt = 0; for (int taro = 0; taro < 70; taro++) { for (int jiro = 0; jiro < taro; jiro++) { cnt += dp1[n][taro] * dp2[n][jiro]; } } ld ans = (ld)cnt / (ld)all; cout << fixed << setprecision(10) << ans << endl; }