#include #include #include using namespace std; static const int INF = 1000000000; int main() { int N, K; cin >> N >> K; clock_t start = clock(); int A = 0, B = 0; while (B <= INF && clock() - start < 4500) { int a = 0, b =0; for (int i = 0; i < N; ++i) b += rand() % 6 + 1; for (int i = 0; i < K; ++i) a += rand() % 3 + 4; for (int i = 0; i < N - K; ++i) a += rand() % 6 + 1; if (a > b) ++A; ++B; } cout << (double)A / (double)B << endl; return 0; }