#include #include using namespace std; double DP[1000007]; double p[7]; int main() { p[1] = 1. / 12; p[2] = 2. / 12; p[3] = 3. / 12; p[4] = 1. / 12; p[5] = 3. / 12; p[6] = 2. / 12; for (int i = 1; i < 1000001; i++) { DP[i] = 1; for (int j = 1; j <= 6; j++) { if (i - j > 0) { DP[i] += DP[i - j] * p[j]; } } } int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; cout << fixed << setprecision(6) << DP[n] << endl; } return 0; }