No.2944 Sigma Partition Problem
タグ : / 解いたユーザー数 58
作問者 :
kazuppa
/ テスター :
👑
Magentor
Story
Generally, when people talk about things that get torn apart, they mean couples and the like, but for the genius mathematician kazuppa, the things that get torn apart are apparently numbers.
Problem Statement
When a sequence consisting of positive integers $x_1,x_2...x_{|x|}$ satisfies all of the following conditions, $x$ is said to be a partition of $m$.
1 n k Output $\displaystyle\sum_{i=1}^k M(n,i)\bmod{998244353}$.2 n k Output $\displaystyle\sum_{i=1}^k L(n,i)\bmod{998244353}$.Input
The input is given from standard input in the following format.$Q$ $Query_1$ $Query_2$ . . . $Query_Q$Each of the $Q$ queries is given in one of the following forms.
$1\ n\ k$
$2\ n\ k$
Constraints
- $1\leq Q\leq $ $100$
- $1\leq n_i,k_i\leq 4000\ (1\leq i\leq Q)$
- All inputs are integers
Output
On line $i$, follow the instruction of the $i$-th query. Print a newline at the end.
Sample
Sample 1
Input
2 1 5 2 2 3 3
Output
3 3
The answer to each query is as follows.
Sample 2
Input
6 2 300 20 1 128 15 2 26 7 1 13 7 1 26 4 2 51 29
Output
50990369 459046796 1009 82 206 236437
Note that the answer must be computed modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。