#define _USE_MATH_DEFINES #include #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// cout << setprecision(16);// int K; cin >> K; vector E(K+6); vector C(K+6); rep(i,K+6){ E[i] = 0; C[i] = 0; } rep(i,5){ E[K+1+i] = 1; } for(int i = K-1; i>=0; --i){ for(int j=1;j<=6;++j){ E[i] += E[i+j]; C[i] += C[i+j]; } E[i] /= 6.0; C[i] /= 6.0; C[i] += 1.0; } LD ans; ans = C[0]/(1-E[0]); P(ans); return 0; }