Олимпиадный тренинг

Задача 38634. Number cookies - 2


Gromozeka has N cookies. The i-th (1<=i<=N) cookie has an integer xi written on it. He chooses one or more of these cookies so that the average value of the integers written on the chosen cookies is A.
In what ways can he make his choice?

Input
The first line contains two integers N (1<=N<=50) and A (1<=A<=50). The second line contains N integers - xi (1<=xi<=50).

Imprint
Print one number - the number of ways to choose such cookies so that the average value of all written numbers on the cookies is exactly A.
 

 

Examples
# Input Output Note
1 4 8
7 9 8 9
5 Below are 5 ways to choose cookies so that the average is 8.
1) Choose the 3rd cookie.
2) Choose the 1st and 2nd cookies.
3) Choose the 1st and 4th cookies.
4) Choose the 1st, 2nd and 3rd cookies.
5) Choose the 1st, 3rd and 4th cookies.
2 3 8
6 6 9
0  
3 8 5
3 6 2 8 7 6 5 9
19  
4 33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
8589934591 The response may not be a 32-bit integer.