AtCoder Beginner Contest 436
翻译中…
Problem Statement
翻译中…
You are given a length-$N$ sequence of positive integers $A=(A _ 1,A _ 2,\ldots,A _ N)$ and a positive integer $M$.
翻译中…
Find the number of length-$N$ sequences of non-negative integers $x=(x _ 1,x _ 2,\ldots,x _ N)$ that satisfy the following condition:
翻译中…
$\displaystyle\sum _ {i=1} ^ NA _ ix _ i\le M$
翻译中…
The number can be very large, so find it modulo $998244353$.
翻译中…
Constraints
翻译中…
$1\le N\le100$$1\le A _ i\le100\ (1\le i\le N)$$1\le M\le10 ^ {18}$- All input values are integers.
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N M
A _ 1 A _ 2 \ldots A _ N
翻译中…
Output
翻译中…
Print the number, modulo $998244353$, of non-negative integer sequences that satisfy the condition.
翻译中…
样例
Input #1
4 6
5 4 3 2
Output #1
10
The sequences $x$ that satisfy the condition are the following $10$: $(0,0,0,0),(0,0,0,1),(0,0,0,2),(0,0,0,3),(0,0,1,0),(0,0,1,1),(0,0,2,0),(0,1,0,0),(0,1,0,1),(1,0,0,0)$.
Thus, print `10`.
Input #2
6 89
4 7 5 10 7 6
Output #2
38469
Input #3
1 1000000007
1
Output #3
1755655
There are $1000000008$ sequences $x$ that satisfy the condition.
Print this modulo $998244353$, which is $1755655$.
Input #4
20 738894495848985641
40 58 13 24 65 11 63 29 98 75 40 77 15 50 83 85 35 46 38 37
Output #4
31156940
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。