#P1164. 小A点菜
小A点菜
Description
However, because uim bought some books, he has only yuan left .
Although the restaurant is low-end, it still has kinds of dishes . The -th dish costs yuan . Since it is a very low-end restaurant, there is only one portion of each dish.
Xiao A follows the rule of “not stopping until all the money is spent,” so he will order in such a way that the total cost is exactly all the money uim has. He wants to know how many different ways to order.
Because Xiao A is too hungry, he can wait at most second.
Input Format
The first line contains two integers and , representing the number of dishes and the amount of money uim has.
The second line contains positive integers (possibly with duplicates), separated by spaces, representing the price of each dish.
Output Format
Output a single positive integer, the number of ordering plans. It is guaranteed that the answer is in the range (does not exceed the C/C++ int range).
4 4
1 1 2 2
3
Hint
2020.8.29, added a set of hack testdata by @yummy.
Translated by ChatGPT 5
京公网安备 11011102002149号