#include using namespace std; double dp1[61], dp2[61], tmp[61]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, K; cin >> N >> K; dp1[0] = 1.0; dp2[0] = 1.0; for (int i = 0; i < N; i++) { for (int j = 0; j <= 60; j++) tmp[j] = 0; for (int j = 0; j <= 60; j++) { for (int k = 1; k <= 6; k++) { if (j + k > 60) continue; tmp[j + k] += dp1[j] / 6; } } for (int j = 0; j <= 60; j++) dp1[j] = tmp[j]; } for (int i = 0; i < N - K; i++) { for (int j = 0; j <= 60; j++) tmp[j] = 0; for (int j = 0; j <= 60; j++) { for (int k = 1; k <= 6; k++) { if (j + k > 60) continue; tmp[j + k] += dp2[j] / 6; } } for (int j = 0; j <= 60; j++) dp2[j] = tmp[j]; } for (int i = 0; i < K; i++) { for (int j = 0; j <= 60; j++) tmp[j] = 0; for (int j = 0; j <= 60; j++) { for (int k = 4; k <= 6; k++) { if (j + k > 60) continue; tmp[j + k] += dp2[j] / 3; } } for (int j = 0; j <= 60; j++) dp2[j] = tmp[j]; } double ans = 0.0; for (int i = 0; i <= 60; i++) { double p = 0.0; for (int j = i + 1; j <= 60; j++) { p += dp2[j]; } ans += p * dp1[i]; } cout << ans << endl; return 0; }