#include #include #include #include #include #include using namespace std; const int max_play = 1e7; int main() { int k; cin >> k; int seed = 0; mt19937 mt(seed); uniform_int_distribution<> dice(1, 6); vector count(21, 0); int sum, roll; int play = 0; while (play < max_play) { sum = 0; roll = 0; while (sum < k) { sum += dice(mt); roll++; } count[roll]++; play++; } int total = 0; for (int i = 0; i < count.size(); i++) { total += i * count[i]; // cout << count[i] << endl; } double ans = 1.0 * total / max_play; printf("%.6f\n", ans); return 0; }