创建于 2026/07/16 · 更新于 2026/07/16
Alice and Bob are playing a number guessing game. First, Alice chooses an unknown positive integer uniformly at random from the interval as the secret number. Then, Bob needs to determine the exact value of by asking a series of questions. For each question, Bob can choose an arbitrary positive integer and ask Alice: "Is a multiple of ?" (formally, does hold?). Alice will answer truthfully with "Yes" or "No" to each question.
Bob wants to finish the game as quickly as possible because an upcoming Codeforces round is about to start. Therefore, he dynamically adjusts his questions based on Alice's previous answers to minimize the expected number of questions required to uniquely determine .
Given the upper bound , your task is to calculate this expected number of questions.
Output the answer modulo 998244353. Formally, let the exact answer be an irreducible fraction . You should output , where is the multiplicative inverse of modulo 998244353.
The only line contains a single integer () — the upper bound of the secret number.
Output a single integer — the minimum expected number of questions Bob needs to uniquely determine , modulo 998244353.
3
665496237
7
3
1
0