#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;ii) dp[i+1]+=d; if(i>=j) dp[i+1]+=dp[i-j]; } dp[i+1]=dp[i+1]/6.0+1; } return dp[n]>d; } int main(){ ll t; cin >> t; cout.precision(20); cout.setf(ios::fixed); while(t--){ cin >> n; if(n<200){ double l=0,r=1e9; REP(i,100){ double m=(l+r)/2.0; if(check(m))l=m; else r=m; } cout << (l+r)/2 << endl; }else{ double res = (double)(n+1)+2.0/3.0; cout << res << endl; } } return 0; }