// No.211 素数サイコロと合成数サイコロ (1) // https://yukicoder.me/problems/no/211 // #include #include #include using namespace std; double solve(int K); int main() { int K; cin >> K; double ans = solve(K); cout << setprecision(16) << fixed << ans << endl; } double solve(int K) { vector dice1 {2, 3, 5, 7, 11, 13}; vector dice2 {4, 6, 8, 9, 10, 12}; vector products; for (auto i = 0; i < dice1.size(); i++) { for (auto j = 0; j < dice2.size(); j++) { products.push_back(dice1[i] * dice2[j]); } } int hit = 0; for (auto p: products) { if (p == K) hit++; } return static_cast(hit) / products.size(); }