#include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,first,last) for (int i=first;i y ? x : y) #define MIN(x,y) (x < y ? x : y) int N, K; int trial = 9000000; int main(){ cin >> N >> K; int taro_win = 0; REP(i,0,trial) { int taro_result = 0; int jiro_result = 0; REP(i,0,N){ if (i < K) { taro_result += rand() % 3 + 4; } else { taro_result += rand() % 6 + 1; jiro_result += rand() % 6 + 1; } } if (taro_result > jiro_result) ++taro_win; } printf("%.5f\n", (double)taro_win / trial); }