#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define minimize(a, x) a = std::min(a, x) #define maximize(a, x) a = std::max(a, x) using ll = long long; int const inf = 1<<29; int N; double dp[114514]; double yajue(double x) { REP(i, 1, N+1) { dp[i] = 0; REP(j, 1, 7) { if(i < j) { dp[i] += x; } else { dp[i] += dp[i-j]; } } dp[i] = 1 + dp[i] / 6.0; } return dp[N]; } int main() { int T; cin >> T; while(T--) { int n; cin >> n; N = min(n, 364); double l = 0, r = 114514810; rep(i, 893) { double m = (l + r) / 2.0; if(m <= yajue(m)) { l = m; } else { r = m; } } printf("%.10f\n", l); } return 0; }