#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline ull xor128() { static ull x = 123456789, y = 362436069, z = 521288629, w = 88675123; ull t = (x ^ (x << 11)); x = y, y = z, z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } int main() { auto start = chrono::system_clock::now(); int n, k; cin >> n >> k; ull total = 0, win = 0; while (true) { auto now = chrono::system_clock::now(); auto diff = chrono::duration_cast<chrono::milliseconds>(now - start).count(); if (diff > 4500) break; ++total; int taro = 0, jiro = 0; rep(i, n) { if (i < k) taro += xor128() % 3 + 4; else taro += xor128() % 6 + 1; jiro += xor128() % 6 + 1; } if (taro > jiro) ++win; } Debug(win, total); cout << fixed << setprecision(15) << (double) win / total << endl; return 0; }