Responsive image

问题 1809 --simple counting problem

1809: simple counting problem

时间限制: 2 Sec  内存限制: 128 MB
提交: 2  解决: 2
[提交][状态][讨论版][命题人:]

题目描述

Given m,b,c,n, please calculate the number of sequence x1,x2,x3,…,xm which satisfies :
0≤xi≤bi−c,xi∈Z
∑mi=1xi<n.
Output the answer module 998244353.
1≤m≤50
2≤b≤109,−b+2≤c≤b−1
1≤n<bm+1

输入描述

There are several test cases, please keep reading until EOF.
For each test case, the first line consists of 3 integers m,b,c.
The next line consists of a big integer n.
There are 10 test cases.

输出描述

For each test case, output Case #x: y, which means the the test case number and the answer.

样例输入

2 2 1
3

样例输出

Case #1: 5

来源

 

[提交][状态]
ACM算法攻关部