#include using namespace std; #define REP(i,a,b) for(i=a;i= 0) dp[i] += dp[i-j-1] * p[j]; } } int main(){ int T, N; int i, j, k, loop; double a, b, c; rep(i,6) p[i] = 0; rep(k,5){ a = 0; b = 1; rep(i,k) b -= p[i]; rep(loop,80){ c = (a+b) / 2; p[k] = c; p[5] = 1; rep(i,5) p[5] -= p[i]; calc(k+2); if(dp[k+2] > ans[k]) b = c; else a = c; } p[k] = c; p[5] = 1; rep(i,5) p[5] -= p[i]; } // rep(i,6) printf("%d %.15f\n",i,p[i]); calc(1000001); scanf("%d",&T); while(T--){ scanf("%d",&N); printf("%.15f\n",dp[N]); } return 0; }