output_description: Print the number of ways to select cards such that the average of the written
  integers is exactly A.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N A
      x_1 x_2 ... x_N
attempt: #include <bits/stdc++.h>
  #define FOR(i,a,b) for(int i=(a);i<(b);i++)
  #define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
  #define REP(i,n) for(int i=0;i<(n);i++)
  #define RREP(i,n) for(int i=n-1;i>=0;i--)
  
  #define PB push_back
  #define MP make_pair
  #define ALL(a) (a).begin(),(a).end()
  #define RALL(a) (a).rbegin(),(a).rend()
  #define CLR(a) memset(a,0,sizeof(a))
  #define SET(a,c) memset(a,c,sizeof(a))
  
  #define DEBUG(x) cout<< #x <<": "<<x<<endl
  
  using namespace std;
  
  typedef long long int ll;
  typedef vector<int> vi;
  typedef vector<ll> vl;
  
  const ll INF = INT_MAX/3;
  const ll MOD = 1000000007;
  const double EPS = 1e-14;
  const int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};
  
  ll dp[51][51][2601];
  int main(){
      int N,A,NX,x[51];
      cin >> N >> A;
      REP(i,N) cin >> x[i];
      NX = N * 50;
      dp[0][0][0] = 1;
  
      REP(i,N)REP(j,N)REP(k,NX){
          dp[i+1][j+1][k+x[i]] += dp[i][j][k];
          dp[i+1][j][k] += dp[i][j][k];
      }
  
      ll ans = 0;
      FOR(i,1,N+1) ans += dp[N][i][A*i];
      cout << ans << endl;
  
      return 0;
  }
  
  
  
problem_description: Statement
  
  Tak has N cards. On the i-th (1 \leq i \leq N) card is written an integer x_i.
  He is selecting one or more cards from these N cards, so that the average of
  the integers written on the selected cards is exactly A. In how many ways can
  he make his selection?
samples: [{"input": "4 8\n    7 9 8 9", "output": "5\n    \n\n  * The following are the 5 ways to select cards such that the average is 8:\n    * Select the 3-rd card.\n    * Select the 1-st and 2-nd cards.\n    * Select the 1-st and 4-th cards.\n    * Select the 1-st, 2-nd and 3-rd cards.\n    * Select the 1-st, 3-rd and 4-th cards.\n\n* * *"}, {"input": "3 8\n    6 6 9", "output": "0\n    \n\n* * *"}, {"input": "8 5\n    3 6 2 8 7 6 5 9", "output": "19\n    \n\n* * *"}, {"input": "33 3\n    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", "output": "8589934591\n    \n\n  * The answer may not fit into a 32-bit integer."}]