int t; std::cin >> t; for (int cas = 1; cas <= t; ++cas) { int n; std::cin >> n; std::function<double(int)> dfs = [&](int x) { if (vis[x])return dp[x];
vis[x] = true;
auto& ans = dp[x]; ans = 0; int useful = 0; int cnt = 0; for (int i = 0; i < prime.size() && prime[i] <= x; ++i) { cnt++; if (x % prime[i] == 0) { useful++; ans += dfs(x / prime[i]); } } ans = (ans + cnt) / useful; return ans;
}; double ans = dfs(n); std::cout << "Case " << cas << ": " << std::fixed << std::setprecision(10) << ans << '\n'; } return0; }