#P1450. [HAOI2008] 硬币购物
[HAOI2008] 硬币购物
Description
There are types of coins with face values .
A person goes shopping times. For each purchase, they carry coins of type and want to buy items worth an amount of . For each purchase, how many payment methods are there?
Input Format
The first line contains five integers, representing .
The next lines each contain five integers describing one purchase, representing .
Output Format
For each purchase, output one line with a single integer representing the answer.
1 2 5 10 2
3 2 3 1 10
1000 2 2 2 900
4
27
Hint
- Constraints
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号