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.

-----Constraints-----
 - 1 \leq N, K \leq 10000
 - 1 \leq Y < X \leq 10000
 - N,\,K,\,X,\,Y are integers.

-----Input-----
The input is given from Standard Input in the following format:
N
K
X
Y

-----Output-----
Print Tak's total accommodation fee.

-----Sample Input-----
5
3
10000
9000

-----Sample Output-----
48000

The accommodation fee is as follows:
 - 10000 yen for the 1-st night
 - 10000 yen for the 2-nd night
 - 10000 yen for the 3-rd night
 - 9000 yen for the 4-th night
 - 9000 yen for the 5-th night
Thus, the total is 48000 yen.
[{"code": "\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif K < N:\n    ans = K*X + (N-K)*Y\nelse:\n    ans = N*X\nprint(ans)", "passed": true, "time": 0.18, "memory": 14024.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for _ in range(4)]\nprint(X * min(K, N) + Y * max(0, N - K))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for _ in range(4)]\n\nif k <= n:\n    sum = (x * k) + (y * (n-k))\nelse:\n    sum = x * n\n\nprint(sum)", "passed": true, "time": 0.15, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k :\n  print(k*x + (n-k)*y)\nelif n <= k:\n  print(n*x)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "import math\nfrom datetime import date\n\ndef main():\n\t\n\tn = int(input())\n\tk = int(input())\n\tx = int(input())\n\ty = int(input())\t\n\t\n\tans = max(0, n - k) * y + min(n, k) * x;\n\tprint(ans)\n\nmain()\n", "passed": true, "time": 0.17, "memory": 16580.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for i in range(4)]\nif n<=k:\n    print(n*x)\nelse:\n    print(k*x+(n-k)*y)", "passed": true, "time": 0.19, "memory": 14228.0, "status": "done"}, {"code": "N,K,x,y = [int(input()) for i in range(4)]\n\nif K<N:\n  print((N-K)*y + K*x)\n  \nelse:\n  print(N*x)", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    print(k*x+(n-k)*y)\nelse: \n    print(n*x)", "passed": true, "time": 0.22, "memory": 14168.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n    print(K*X+(N-K)*Y)\nelse:\n    print(N*X)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a,b,c,d = [int(input()) for i in range(4)]\nif a<b:\n\tprint(a*c)\nelse:\n\tprint((b*c) +((a-b) * d) )", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N <= K:\n  print(N * X)\nelse:\n  print(K * X + (N - K) * Y)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint(x * min(n, k) + y * max(n-k, 0))", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "# 044_a\n# A - \u9ad8\u6a4b\u541b\u3068\u30db\u30c6\u30eb\u30a4\u30fc\u30b8\u30fc\n\nN = int(input())  # \u9023\u6cca\u6570\nK = int(input())  # \u6599\u91d1\u5909\u52d5\u6cca\u6570\nX = int(input())  # \u901a\u5e38\u4fa1\u683c\nY = int(input())  # \u5909\u52d5\u4fa1\u683c\n\nif ((1 <= N & N <= 10000) & (1 <= K & K <= 10000)) \\\n        & (1 <= X & X <= 10000) & (1 <= Y & Y <= 10000):\n    if (X > Y):\n        price = 0\n        if (N < K):\n            for i in range(1, N + 1):\n                price += X\n        if (N >= K):\n            for i in range(1, K + 1):\n                price += X\n            for j in range(K + 1, N + 1):\n                price += Y\n        print(price)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for i in range(4)]\ncost = (min(n,k)*x+max(0,n-k)*y)\nprint(cost)", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nans = 0\nif n <= k:\n    ans = n*x\nelse:\n    ans = k*x + (n-k)*y\nprint(ans)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n  ans = k * x + (n - k) * y\n  \nelse:\n  ans = n * x\n  \nprint(ans)", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint((min(k, n)*x + max(n-k, 0)*y))\n", "passed": true, "time": 0.2, "memory": 14100.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nfirst=min(n,k)\nre=first*x\nre+=max((n-first),0)*y\nprint(re)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    k = int(input())\n    x = int(input())\n    y = int(input())\n\n    if n <= k :\n        ans = x * n\n    else :\n        ans = x * k + y * (n - k)\n\n    print(ans)\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "# \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f\u30011\u6cca\u3042\u305f\u308aX\u5186\n# K+1\u6cca\u76ee\u4ee5\u964d\u306f\u30011\u6cca\u3042\u305f\u308aY\u5186\n# N\u6cca\u3057\u305f\u3068\u304d\u306e\u5bbf\u6cca\u8cbb\n\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n    print(X * N)\nelse:\n    print(X * K + Y * (N - K))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nans = 0\n\nfor i in range(1,N+1):\n  if i<=K:\n    ans += X\n  else:\n    ans += Y\n    \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n > k:\n  print(x * k + y * (n - k))\nelse:\n  print(x * n)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n >= k:\n    print(k*x + (n-k)*y)\nelse:\n    print(n*x)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    print((k*x+(n-k)*y))\nelse:\n    print((n*x))\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "# \u6570\u5024\u306e\u53d6\u5f97\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\n# \u5bbf\u6cca\u8cbb\u306e\u8a08\u7b97\u5f8c\u7d50\u679c\u3092\u51fa\u529b\nif N <= K:\n  account = N * X\nelse:\n  account = (K * X) + (max(N - K,0) * Y) \n  \nprint(account)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nans = 0\n\nif N > K:\n    for i in range(0, K):\n        ans += X\n    for i in range(K, N):\n        ans += Y\nelif N <= K:\n    for i in range(0, N):\n        ans += X\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nN = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n    cost = N * X\nelse:\n    cost = K * X + (N - K) * Y\n\nprint(cost)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n\nif N<=K:\n  print(X*N)\nelse:\n  print(X*K+Y*(N-K))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\n\nprint(min(k,n)*x+max(0,n-k)*y)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "\"\"\"\nABC044 A \u9ad8\u6a4b\u541b\u3068\u30db\u30c6\u30eb\u30a4\u30fc\u30b8\u30fc\nhttps://kenkoooo.com/atcoder/#/table/Tsukumo\n\"\"\"\n\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    ans = k*x + (n-k)*y\nelse:\n    ans = n*x\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "n= int(input())\nk= int(input())\nx= int(input())\ny= int(input())\nprint((x*n if k>=n else (n-k)*y+x*k))\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nprint((min(k, n)*x + max((n-k)*y, 0)))\n", "passed": true, "time": 0.16, "memory": 14008.0, "status": "done"}, {"code": "def solve():\n    n = int(input())\n    k = int(input())\n    x = int(input())\n    y = int(input())\n    print((x * min(n, k) + y * max(n-k,0)))\n\n\ndef __starting_point():\n    solve()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14272.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n <= k:\n  print(n*x)\nelse:\n  print(k*x + (n-k)*y)", "passed": true, "time": 1.39, "memory": 14044.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n < k: print(x * n)\nelse: print(x * k + y * (n - k))", "passed": true, "time": 0.51, "memory": 14284.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n    SUM = X*K + Y*(N - K)\nelse:\n    SUM = X*N\nprint(SUM)\n", "passed": true, "time": 0.18, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n < k:\n    print(n * x)\nelse:\n    print(k * x + (n - k) * y)", "passed": true, "time": 0.21, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    print(k * x + (n - k) * y)\nelse:\n    print(n * x)", "passed": true, "time": 0.2, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n  print(n*x)\nelse:\n  print(k*x+(n-k)*y)", "passed": true, "time": 0.17, "memory": 14204.0, "status": "done"}, {"code": "# abc044_a\n# https://atcoder.jp/contests/abc044/tasks/abc044_a\n\n# \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f\u3001X\u5186\n# K\uff0b1\u6cca\u76ee\u4ee5\u964d\u306f\u3001Y\u5186\n\n# N\u6cca\u9023\u7d9a\u3067\u5bbf\u6cca\u3057\u305f\u969b\u306e\u5bbf\u6cca\u8cbb\n\n# \u5165\u529b\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\n# \u51e6\u7406\n\n# x\u5186\u3068y\u5186\nif n > k:\n    answer = k * x + (n - k) * y\n# x\u5186\u306e\u307f\nelse:\n    answer = n * x\n\nprint(answer)\n", "passed": true, "time": 0.14, "memory": 14008.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = min(n,k)*x + max(n-k,0)*y\nprint(ans)", "passed": true, "time": 0.18, "memory": 14088.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for _ in range(4)]\nresult = min(N, K)\nN -= result\nresult *= X\n\nif N >= 0:\n  result += N * Y\nprint(result)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for _ in range(4) ]\nans=k*x+(n-k)*y\nprint(ans if n>k else n*x)", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for i in range(4)]\nprint(n*x+min(0,(k-n)*(x-y)))", "passed": true, "time": 0.19, "memory": 14080.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\nif K<N:\n    print((X*K+Y*(N-K)))\nelse:\n    print((X*N))\n\n", "passed": true, "time": 0.25, "memory": 14164.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for _ in range(4)]\nprint((min(n,k)*x + max(0,n-k)*y))\n", "passed": true, "time": 0.23, "memory": 14108.0, "status": "done"}, {"code": "n,k,x,y=int(input()),int(input()),int(input()),int(input())\nif n<k:print(x*n)\nelse:print(x*k+y*(n-k))", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "import sys\nimport math\n\n#https://atcoder.jp/contests/agc008/submissions/15248942\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninm = lambda: map(int, sys.stdin.readline().split())\ninl = lambda: list(inm())\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\nN = ini()\nK = ini()\nX = ini()\nY = ini()\n\nif N > K:\n    print(K*X+(N-K)*Y)\nelse:\n    print(N*X)\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N, K, X, Y = [int(input()) for i in range(4)]\nprint(K * X + (N - K) * Y if N > K else N * X)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nans=0\nif n>=k:\n    ans+=x*k\n    n-=k\n    ans+=y*n\nelse:\n    ans+=x*n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif k <= n:\n  print(k*x+(n-k)*y)\nelse:\n  print(n*x)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "total=int(input()) #\u5bbf\u6cca\u65e5\u6570\ndisc=int(input()) #\u521d\u3081\u306e\u5272\u5f15\u306a\u3057\u65e5\u6570\npriceX=int(input()) #\u5272\u5f15\u306a\u3044\u5024\u6bb5\npriceY=int(input()) #\u5272\u5f15\u5f8c\u306e\u5024\u6bb5\n\nans=()\nif total<=disc:\n  ans=total*priceX\nelse:\n  ans=disc*priceX+(total-disc)*priceY\nprint(ans)", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nans = 0\n\nfor i in range(N):\n    if i + 1 <= K:\n        ans += X\n    else:\n        ans += Y\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N = int(input())    # N\u6cca\nK = int(input())    # \u6700\u521d\u306eK\u6cca\u307e\u3067\u306f1\u6cca\u5f53\u305f\u308aX\u5186\nX = int(input())\nY = int(input())    # K+1\u6cca\u76ee\u4ee5\u964d\u306f1\u6cca\u5f53\u305f\u308aY\u5186\n\nif N - K > 0:\n    total = (K * X) + ((N - K) * Y)\nelse:\n    total = N * X\n\nprint(total)\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n,k,x,y=[int(input()) for _ in range(4)];print([n*x,k*x+(n-k)*y][n-k>0])", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n    ans = X * N\nelse:\n    ans = X * K + (N - K) * Y\nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "import sys\n\ndef I(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\ndef LI(): return list(map(int, sys.stdin.readline().split()))\ndef main():\n    n = I()\n    k = I()\n    x = I()\n    y = I()\n    if n <= k:\n        print(n*x)\n    else:\n        print(k*x + (n-k)*y)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\ns = 0\nfor i in range(1, n+1, 1):\n    if i <= k:\n        s += x\n    else:\n        s += y\nprint(s)\n", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\n\nif n <= k:\n  print(n*x)\n  \nelse:\n  print(k*x+(n-k)*y)", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif K < N:\n    print(K * X + (N - K) * Y)\nelse:\n    print(N * X)", "passed": true, "time": 0.17, "memory": 14196.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\ndef main():\n    n = int(input())\n    k = int(input())\n    x = int(input())\n    y = int(input())\n    print((n * x - (x - y) * max(n - k, 0)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\n\nif n <= k:\n  print((n*x))\nelse:\n  print((k*x+(n-k)*y))", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\nprint((K*X+(N-K)*Y if N>=K else X*N))\n", "passed": true, "time": 0.16, "memory": 14084.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nfees=0\nif(k>n or n==k):\n\tfor i in range(0,n):\n\t\tfees+=x\nelif(k<n):\n\tdiff=n-k\n\tfor j in range(0,k):\n\t\tfees+=x\n\tfor k in range(0,diff):\n\t\tfees+=y\n\t\t\nprint(fees)\n", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n<=k:\n    print(n*x)\nelse:\n    tmp = (n-k) * y + k * x\n    print(tmp)", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n \nif N<=K:\n  print(X*N)\nelse:\n  print(K * X + (N - K) * Y)", "passed": true, "time": 0.16, "memory": 14048.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nif N > K:\n    print(K * X + (N - K) * Y)\nelse:\n    print(N * X)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = min(n, k) * x\nn -= min(n, k)\n\nans += n * y\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\ncost = 0\nif n > k:\n    for i in range(k):\n        cost += x\n\n    for j in range(k, n):\n        cost += y\n    print(cost)\n\nelif n <= k:\n    for i in range(n):\n        cost += x\n    print(cost)\n\n\n", "passed": true, "time": 0.16, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nif k<n:\n    print(k*x+(n-k)*y)\nelse:\n    print(n*x)", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "N,K,X,Y=[int(input()) for i in range(4)]\n\nif(K>=N):\n  Z=N*X\n  print(Z)\nelse:\n  Z=K*X+(N-K)*Y\n  print(Z)", "passed": true, "time": 0.16, "memory": 14300.0, "status": "done"}, {"code": "n, k, x, y = [int(input()) for _ in range(4)]\nif n <= k:\n    print(x * n)\nelse:\n    print(x * k + y * (n - k))", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nif n<k:\n  print(n*x)\nelse:\n  print(k*x+(n-k)*y)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "class Combination:\n    def __init__(self, n, mod):\n        self.n = n\n        self.mod = mod\n        self.fac = [1 for i in range(self.n + 1)]\n        self.finv = [1 for i in range(self.n + 1)]\n        for i in range(2, self.n+1):\n            self.fac[i] = (self.fac[i - 1] * i) % self.mod\n            self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod\n\n    def comb(self, n, m):\n        return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod\ndef iparse():\n    return list(map(int, input().split()))\n\ndef __starting_point():\n    n = int(input())\n    k = int(input())\n    x = int(input())\n    y = int(input())\n\n    print((min(k,n)*x + max(0,n-k)*y))\n    \n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\n\nif N <= K:\n    print(N * X)\nelif N >= K:\n    k_stay = K * X\n    k_plus_stay = (N - K) * Y\n    print(k_plus_stay + k_stay)", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nn1 = n - k\nif n > k:\n    print((k*x)+(y*n1))\nelse:\n    print(n*x)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n\nif N<=K:\n    print((X*N))\nelse:\n    print((X*K+Y*(N-K)))\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n >= k:\n    print((k * x) + (n - k) * y)\nelse:\n    print(n * x)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nans = 0\nfor i in range(n):\n  if i < k:\n    ans += x\n  else:\n    ans += y\n    \nprint(ans)", "passed": true, "time": 0.24, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nK = int(input())\nX = int(input())\nY = int(input())\nprice = 0\nif N <= K:\n  for i in range(N):\n    price += X\n  print(price)\nelse:\n  for i in range(K):\n    price += X\n  for i in range(N-K):\n    price += Y\n  print(price)", "passed": true, "time": 0.24, "memory": 14076.0, "status": "done"}, {"code": "import sys\nfrom heapq import heappush, heappop, heapify\nimport math\nfrom math import gcd\nimport itertools as it\nfrom collections import deque \n\ninput = sys.stdin.readline\n\ndef inp():\n    return int(input())\ndef inpl():\n    return list(map(int, input().split()))\n\nINF = 1001001001\n\n# ---------------------------------------\n\ndef main():\n    n = inp()\n    k = inp()\n    x = inp()\n    y = inp()\n    if n > k:\n        print((x * k + y * (n - k)))\n    else:\n        print((x * n))\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n<k:\n  print(n*x)\nelse:\n  print((n-k)*y + k*x)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "L = [int(input()) for _ in range(4)]\nprint(L[2]*min(L[0],L[1])+L[3]*max(0,L[0]-L[1]))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n \nn1 = n - k\nif n > k:\n    print((k*x)+(y*n1))\nelse:\n    print(n*x)", "passed": true, "time": 0.24, "memory": 14084.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n    print(x*n)\nelse:\n    print((x*k) + (y*(n-k)))", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "def iroha():\n    n, k, price, special = [int(input()) for i in range(4)]\n    result = 0\n    for i in range(n):\n        if i < k:\n            result += price\n        else:\n            result += special\n    print(result)\n\ndef __starting_point():\n    iroha()\n\n__starting_point()", "passed": true, "time": 0.24, "memory": 14072.0, "status": "done"}, {"code": "a,b,c,d=[int(input()) for i in range(4)]\nprint(min(a,b)*c+max(0,(a-b))*d)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n,k,x,y = [int(input()) for i in range(4)]\ncost=(min(n,k)*x+max(0,n-k)*y)\nprint(cost)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "val = [int(input()) for i in range(4)]\nif val[0] > val[1] :\n    print(val[1] * val[2] + (val[0] - val[1]) * val[3])\nelse:\n    print(val[0] * val[2])", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "import sys\nN, K, X, Y = map(int, sys.stdin.readlines())\nprint(N*X if N <= K else K*X +Y*(N-K))", "passed": true, "time": 0.16, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    total = (k * x) + (n - k) * y\n    print(total)\nelse:\n    total = n * x\n    print(total)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nans = 0\nif n>k:\n  ans = (k*x) + (n-k)*y\nelse:\n  ans = n*x\nprint(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N=int(input())\nK=int(input())\nX=int(input())\nY=int(input())\n#print(type(N))\n\nif N<=K:\n  daikin = X*N\nelse:\n  daikin = X*K+Y*(N-K)\nprint(daikin)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "\nn = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\nif n <= k:\n  print(n*x)\nelse:\n  print(k*x + (n-k)*y)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n <= k:\n    print((n*x))\nelse:\n    print((k*x + (n-k)*y))\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "total = int(input())\ninitial = int(input())\nif initial > total:\n  initial = total\na = int(input())\nb = int(input())\ncount = 0\nfor i in range(initial):\n  count+= a\nfor c in range(total - initial):\n  count+=b\n\nprint(count)\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "from sys import stdin\ninput = stdin.readline\n\nn, k, x, y = list(map(int, stdin.read().split()))\n\nprint((min(k, n) * x + max(0, n - k) * y))\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "n=int(input())\nk=int(input())\nx=int(input())\ny=int(input())\nans =0\nfor i in range(n):\n    if(i+1<=k):\n        ans += x\n    if(i+1>k):\n        ans += y\nprint(ans)\n        \n", "passed": true, "time": 0.16, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\nk = int(input())\nx = int(input())\ny = int(input())\n\nif n > k:\n    print(k*x+(n-k)*y)\nelse: \n    print(n*x)", "passed": true, "time": 0.14, "memory": 14040.0, "status": "done"}]