#P4389. 付公主的背包
付公主的背包
Description
This backpack can hold a total size of at most .
Princess Fu has types of goods and she is about to set up a stall.
Each type has volume , and there are infinitely many pieces available.
Given , for , please answer the number of ways to fill exactly volume using these goods.
Input Format
The first line contains two positive integers . The second line contains positive integers, representing the volume of each type of good.
Output Format
Output lines, where the -th line represents the number of ways when , taken modulo .
2 4
1 2
1
2
2
3
Hint
Constraints
For 30% of the testdata, .
For 60% of the testdata, purely randomly generated.
For 100% of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号