#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int N, K; bool trial(mt19937 &mt) { int taro = 0; int jiro = 0; for (int i = 0; i < K; i++) { taro += mt() % 3 + 4; jiro += mt() % 6 + 1; } for (int i = 0; i < N - K; i++) { taro += mt() % 6 + 1; jiro += mt() % 6 + 1; } return taro > jiro; } double monte(mt19937 &mt) { int win = 0; int lose = 0; for (int i = 0; i < 100000; i++) { if (trial(mt)) { win++; } else { lose++; } } return (win * 1.0 / (win + lose)); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); random_device rnd; mt19937 mt(rnd()); cin >> N >> K; cout << monte(mt) << endl; return 0; }