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: n, a = map(int, input().split())
  x = list(map(int, input().split()))
  
  # dp[j][k][s] = (x0...xj からk枚選んでxiの合計をsにするような選び方の総数)
  dp = [[[0 for s in range(a * n + 1)] for k in range(n + 1)] for j in range(n)]
  
  for j in range(n):
      dp[j][0][0] = 1
      if x[0] <= a * n:
          dp[j][1][x[0]] = 1
  
  for j in range(n - 1):
      for k in range(n + 1):
          for s in range(a * n + 1):
              if k > j + 2:
                  dp[j + 1][k][s] = 0
              elif s >= x[j + 1] and k >= 1:
                  dp[j + 1][k][s] = dp[j][k][s] + dp[j][k - 1][s - x[j + 1]]
              else:
                  dp[j + 1][k][s] = dp[j][k][s]
  
  res = 0
  for i in range(1, n + 1):
      res += dp[n - 1][i][a * i]
  
  print(1)
  
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"}]