#include #include #include using namespace std; #define N 20 int main(){ long long num_data[N + 1]; long long one_data[N + 1]; long long nc; long long n; double ans_data[N + 1]; vector vnum; num_data[1] = 1; n = 2; cin >> nc; for (long long i = 2; i <= nc; i++) num_data[i] = n, n *= i + 1; one_data[1] = 1; for (long long i = 2; i <= nc; i++) one_data[i] = num_data[i - 1] * 2; ans_data[1] = 1.0; ans_data[2] = 2.0; long long w = 2; for (long long i = 3; i <= nc; i++){ for (long long j = 1; j < i - 1; j++){ vnum.push_back((i - 1)*j); } ans_data[i] = one_data[i]; long long c = (num_data[i] - one_data[i]) / vnum.size(); int s = vnum.size(); for (long long j = 0; j < s; j++){ ans_data[i] += vnum[j]*c; } w *= i; ans_data[i] /= w; ans_data[i] += ans_data[i - 1]; } printf("%.12f\n", ans_data[nc]); }