#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) if(j>i) dp[i] += d; if(i>j) dp[i] += dp[i-j]; } dp[i]=dp[i]/6.0+1; } return dp[a]; } void solve2(ll a) { int i,j,k,l,r,x,y; string s; double L=0,R=1e10; FOR(i,100) { double M=(L+R)/2.0; if(test(M,a)>=M) L=M; else R=M; } _P("%.12lf\n",(L+R)/2.0); } int T; ll N; void solve() { int i,j,k,l,r,x,y; string s; cin>>T; while(T--) { cin>>N; if(N<=200) solve2(N); else { _P("%.12lf\n",N+1+2.0/3); } } } 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; }