#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ int n, k; double anst = 0; cin >> n >> k; vector> taro(n+1, vector(n*6+1)), jiro(n+1, vector(n*6+1)); taro[0][0] = 1.0, jiro[0][0] = 1.0; for (int i = 1; i <= n; i++){ for (int j = 1; j <= i*6; j++){ if (k >= i){ for (int l = 4; l <= 6; l++){ if (j - l >= 0) taro[i][j] += taro[i-1][j-l]/3; } for (int l = 1; l <= 6; l++){ if (j - l >= 0) jiro[i][j] += jiro[i-1][j-l]/6; } } else { for (int l = 1; l <= 6; l++){ if (j - l >= 0){ taro[i][j] += taro[i-1][j-l]/6; jiro[i][j] += jiro[i-1][j-l]/6; } } } } } for (int i = 1; i <= n*6; i++){ for (int j = 1; j < i; j++){ anst += taro[n][i]*jiro[n][j]; } } cout << anst << endl; }