output_description: Print Tak's total accommodation fee.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      K
      X
      Y
attempt: import numpy as np
  
  N, A = map(int, input().split())
  x = list(map(int, input().split()))
  
  X = max(x)
  if X < A:
      X = A
  
  
  def check(j, k, s):
      if dp[j][k][s] != -1:
          return dp[j][k][s]
      if j == 0 and k == 0 and s == 0:
          dp[j][k][s] = 1
          return 1
      if j >= 1 and s < x[j - 1]:
          a = check(j - 1, k, s)
          dp[j][k][s] = a
          return a
      if j >= 1 and k >= 1 and s >= x[j - 1]:
          a = check(j - 1, k, s) + check(j - 1, k - 1, s - x[j - 1])
          dp[j][k][s] = a
          return a
      dp[j][k][s] = 0
      return 0
  
  
  dp = [[[-1] * (N * X + 1) for _ in range(N + 1)] for _ in range(N + 1)]
  dp = np.array(dp)
  # print (dp)
  # for j in range(N+1):
  #     for k in range(N+1):
  #         for s in range(N*X + 1):
  #             print (j, k, s)
  #             dp[j][k][s] = check(j, k, s)
  
  ans = 0
  for k in range(1, N + 1):
      ans += check(N, k, k * A)
      # ans += dp[N][k][k * A]
  
  print(ans)
  
problem_description: Statement
  
  There is a hotel with the following accommodation fee:
  
    * X yen (the currency of Japan) per night, for the first K nights
    * Y yen per night, for the (K+1)-th and subsequent nights
  
  Tak is staying at this hotel for N consecutive nights. Find his total
  accommodation fee.
samples: [{"input": "5\n    3\n    10000\n    9000", "output": "48000\n    \n\nThe accommodation fee is as follows:\n\n  * 10000 yen for the 1-st night\n  * 10000 yen for the 2-nd night\n  * 10000 yen for the 3-rd night\n  * 9000 yen for the 4-th night\n  * 9000 yen for the 5-th night\n\nThus, the total is 48000 yen.\n\n* * *"}, {"input": "2\n    3\n    10000\n    9000", "output": "20000"}]