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: from itertools import combinations, product
  
  
  def gcd(a, b):
      if a < b:
          a, b = b, a
      while b != 0:
          a, b = b, a % b
      return a
  
  
  def lcm(a, b):
      return a * b // gcd(a, b)
  
  
  def get(fmt):
      ps = input().split()
      r = []
      for p, t in zip(ps, fmt):
          if t == "i":
              r.append(int(p))
          if t == "f":
              r.append(float(p))
          if t == "s":
              r.append(p)
      if len(r) == 1:
          r = r[0]
      return r
  
  
  def put(*args, **kwargs):
      print(*args, **kwargs)
  
  
  def rep(n, f, *args, **kwargs):
      return [f(*args, **kwargs) for _ in range(n)]
  
  
  def rep_im(n, v):
      return rep(n, lambda: v)
  
  
  YES_NO = ["NO", "YES"]
  
  
  N, K, X, Y = rep(4, get, "i")
  
  p = N * X - max(N - K, 0) * (X - Y)
  
  put(p)
  
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"}]