#include #include #include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; const ll MOD = 1e9 + 7; #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) // bool operator<(const pair &a, const pair &b) // { // if (a.first == b.first) // return a.second < b.second; // return a.first < b.first; // }; unsigned int xor128(void) { static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123; unsigned int t = (x ^ (x << 11)); x = y; y = z; z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } unsigned int xor128rnd(unsigned int m) { return xor128() % m; } int main(void) { int N, K; cin >> N >> K; clock_t t = clock() + CLOCKS_PER_SEC * 2; int win = 0, total = 1; while (t >= clock()) { int sum = 0; REP(i, N) sum += xor128rnd(6) + 1; REP(i, N - K) sum -= xor128rnd(6) + 1; REP(i, K) sum -= xor128rnd(3) + 4; if (sum < 0) win++; total++; } cout << fixed << setprecision(9) << 1.0 * win / total << endl; return 0; }