CF1709F.Multiset of Strings
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given three integers n , k and f .
Consider all binary strings (i. e. all strings consisting of characters 0 and/or 1 ) of length from 1 to n . For every such string s , you need to choose an integer cs from 0 to k .
A multiset of binary strings of length exactly n is considered beautiful if for every binary string s with length from 1 to n , the number of strings in the multiset such that s is their prefix is not exceeding cs .
For example, let n=2 , c0=3 , c00=1 , c01=2 , c1=1 , c10=2 , and c11=3 . The multiset of strings {11,01,00,01} is beautiful, since:
- for the string 0 , there are 3 strings in the multiset such that 0 is their prefix, and 3≤c0 ;
- for the string 00 , there is one string in the multiset such that 00 is its prefix, and 1≤c00 ;
- for the string 01 , there are 2 strings in the multiset such that 01 is their prefix, and 2≤c01 ;
- for the string 1 , there is one string in the multiset such that 1 is its prefix, and 1≤c1 ;
- for the string 10 , there are 0 strings in the multiset such that 10 is their prefix, and 0≤c10 ;
- for the string 11 , there is one string in the multiset such that 11 is its prefix, and 1≤c11 .
Now, for the problem itself. You have to calculate the number of ways to choose the integer cs for every binary string s of length from 1 to n in such a way that the maximum possible size of a beautiful multiset is exactly f .
输入格式
The only line of input contains three integers n , k and f ( 1≤n≤15 ; 1≤k,f≤2⋅105 ).
输出格式
Print one integer — the number of ways to choose the integer cs for every binary string s of length from 1 to n in such a way that the maximum possible size of a beautiful multiset is exactly f . Since it can be huge, print it modulo 998244353 .
输入输出样例
输入#1
1 42 2
输出#1
3
输入#2
2 37 13
输出#2
36871576
输入#3
4 1252 325
输出#3
861735572
输入#4
6 153 23699
输出#4
0
输入#5
15 200000 198756
输出#5
612404746
说明/提示
In the first example, the three ways to choose the integers cs are:
- c0=0 , c1=2 , then the maximum beautiful multiset is {1,1} ;
- c0=1 , c1=1 , then the maximum beautiful multiset is {0,1} ;
- c0=2 , c1=0 , then the maximum beautiful multiset is {0,0} .