#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define CLEAR(d) memset((d), 0, (sizeof((d)))) #define ALL(c) (c).begin(), (c).end() #define SORT(x) sort((x).begin(), (x).end()) #define RSORT(x) sort((x).begin(), (x).end(), greater() ) #define SIZE(a) ((int)((a).size())) #define MAX3(a, b, c) (max(max((a), (b)), (c))) #define MIN3(a, b, c) (min(min((a), (b)), (c))) #define MOD 1000000007 #define EPS 1e-5 #define PI (acos(-1)) #define INF 10000000 struct edge{ int to, cost; }; //=================================================== int xor128() { static int x = 123456789; static int y = 362436069; static int z = 521288629; static int w = 88675123; int t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } int main() { int n, k, win = 0, play = 0; cin >> n >> k; for (play = 0; play < 1000000; play++) { int sum1 = 0, sum2 = 0; for (int i = 0; i < n; i++) { sum1 += xor128() % 6 + 1; if (i < n - k) { sum2 += xor128() % 6 + 1; } else { sum2 += xor128() % 3 + 4; } } if (sum2 > sum1) win++; } printf("%f\n", (double)win / play); return 0; }