CF1310E.Strange Function

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Let's define the function ff of multiset aa as the multiset of number of occurences of every number, that is present in aa .

E.g., f({5,5,1,2,5,2,3,3,9,5})={1,1,2,2,4}f(\{5, 5, 1, 2, 5, 2, 3, 3, 9, 5\}) = \{1, 1, 2, 2, 4\} .

Let's define fk(a)f^k(a) , as applying ff to array aa kk times: fk(a)=f(fk1(a)),f0(a)=af^k(a) = f(f^{k-1}(a)), f^0(a) = a .

E.g., f2({5,5,1,2,5,2,3,3,9,5})={1,2,2}f^2(\{5, 5, 1, 2, 5, 2, 3, 3, 9, 5\}) = \{1, 2, 2\} .

You are given integers n,kn, k and you are asked how many different values the function fk(a)f^k(a) can have, where aa is arbitrary non-empty array with numbers of size no more than nn . Print the answer modulo 998244353998\,244\,353 .

输入格式

The first and only line of input consists of two integers n,kn, k ( 1n,k20201 \le n, k \le 2020 ).

输出格式

Print one number — the number of different values of function fk(a)f^k(a) on all possible non-empty arrays with no more than nn elements modulo 998244353998\,244\,353 .

输入输出样例

  • 输入#1

    3 1

    输出#1

    6
  • 输入#2

    5 6

    输出#2

    1
  • 输入#3

    10 1

    输出#3

    138
  • 输入#4

    10 2

    输出#4

    33
首页