#include #include using namespace std; int main(void){ int K; cin >> K; vector v(K, 0.0); v[K-1] = 1.0; for(int i = K-2; i >= 0; i--){ double t = 0.0; for(int j = 1; j <= 6; j++){ if(i + j >= K) continue; t += (v[i+j] / 6.0); } t += 1.0; v[i] = t; } cout << v[0] << endl; return 0; }