No.2081 Make a Test Case of GCD Subset
タグ : / 解いたユーザー数 43
作問者 :
taiga0629kyopro
/ テスター :
Problem Statement
taiga created the following problem.
GCD Subset
You are given a sequence $A$ of positive integers of length $N$. Here, all elements of $A$ are distinct. A non-empty subset $S=\lbrace S_1,S_2,\dots,S_k \rbrace$ of $\lbrace 1,2, \dots ,N \rbrace$ is called a good set if it satisfies the following condition.
- $\gcd(A_{S_1},A_{S_2},\dots,A_{S_k}) \ge 2$ (where $\gcd(X_1,X_2,\dots,X_k)$ denotes the greatest common divisor of $X_1,X_2,\dots,X_k$.)
There are $2^N-1$ non-empty subsets of $\lbrace 1,2, \dots ,N \rbrace$. Find the number of good sets among them, modulo $998244353$.
You are given an integer $M$. Output $1$ sequence $A$ for which the answer to the problem "GCD Subset" is $M$.
Input
$M$
Output
Output the length $N$ of the sequence on line $1$ and the sequence $A$ on line $2$, as shown below. If there are multiple valid answers, any of them will be accepted.
$N$ $A_1$ $A_2$ $\dots$ $A_N$
The output must also satisfy the following constraints.
Output Constraints
Sample
Sample 1
Input
3
Output
3 1 3 6
With $N=3$, $A=(1,3,6)$, the good sets are $\lbrace 2 \rbrace, \lbrace 3 \rbrace, \lbrace 2,3 \rbrace$, which is $3$ sets, so the condition is satisfied. Other outputs are also accepted, for example one for which the number of good sets is $998244353+3$.
Note that output in the following format will be judged incorrect.
3 1 3 6
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。