#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;xi) dp[i] += d; else dp[i] += dp[i-j]; } dp[i]=dp[i]/6.0+1; } return dp[N]; } void solve() { int i,j,k,l,r,x,y; string s; cin>>N; double L=0,R=1e10; FOR(i,100) { double M=(L+R)/2.0; if(test(M)>=M) L=M; else R=M; } _P("%.12lf\n",(L+R)/2.0); } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }