#include // #include // #include using namespace std; // using namespace atcoder; // using bint = boost::multiprecision::cpp_int; using ll = long long; using ull = unsigned long long; using P = pair; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define MOD 1000000007 int main(){ int T; cin >> T; vector p(10); p[1]=1.0/12; p[2]=2.0/12; p[3]=3.0/12; p[4]=1.0/12; p[5]=3.0/12; p[6]=2.0/12; cout << fixed << setprecision(20); while(T--){ int n; cin >> n; vector back(n+1); for(int i = n-1;i >= 0;i--){ for(int j = 1;j <= 6;j++)back[i] += (back[min(i+j,n)]+1)*p[j]; } cout << back[0] << "\n"; } return 0; }