/* -*- coding: utf-8 -*- * * 567.cc: No.567 コンプリート - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int D = 6; const int DBITS = 1 << D; /* typedef */ /* global variables */ double dp[2][DBITS]; /* subroutines */ /* main */ int main() { int n; cin >> n; dp[0][0] = 1.0; int cur = 0, nxt = 1; for (int i = 0; i < n; i++) { fill(dp[nxt], dp[nxt] + DBITS, 0); for (int bits = 0; bits < DBITS; bits++) for (int d = 0, bd = 1; d < D; d++, bd <<= 1) dp[nxt][bits | bd] += dp[cur][bits] / D; cur ^= 1, nxt ^= 1; } printf("%.8lf\n", dp[cur][DBITS - 1]); }