Problem:


Score : 100 points

Problem 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.

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 1

5
3
10000
9000

Sample Output 1

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.

Sample Input 2

2
3
10000
9000

Sample Output 2

20000



Sample input:
5
3
10000
9000


Sample output:
48000

Submission status: Wrong Answer

Solution code:
N = int(input('N = '))
K = int(input('K = '))
X = int(input('X = '))
Y = int(input('Y = '))

if N < K:
    a = N * X
else:
    a = K * X

if N < K:
    b = 0
else:
    b = (N - K) * Y
c = a + b

print(c)

Submission status: Wrong Answer

Solution code:
N = int(input('N = '))
K = int(input('K = '))
X = int(input('X = '))
Y = int(input('Y = '))

if N < K:
    a = N * X
else:
    a = K * X

b = (N - K)*Y
if N < K:
    b = 0

c = a + b

print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
amount = 0
amount1=0
if K < N:
    for i in range(1, K + 1):
        amount = amount + X
if K>N:
    for d in range(1, N+1):
        amount=amount+X
for j in range(K+1,N+1):
    amount1=amount1+Y
total=amount+amount1
print(total)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
amount = 0
amount1=0
if K < N:
    for i in range(1, K + 1):
        amount = amount + X
    print(amount)
if K>N:
    for d in range(1, N+1):
        amount=amount+X
    print(amount)

for j in range(K+1,N+1):
    amount1=amount1+Y
print(amount1)
total=amount+amount1
print(total)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
amount = 0
amount1=0
for i in range(1,K+1):
    amount=amount+X
for j in range(K+1,N+1):
    amount1=amount1+Y
total=amount+amount1
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n-k>0:
  print(((n-k) * y) + (k * x))
else:
  print(k * x)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(((n-k) * y) + (k * x))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(((n-k) * x) + (k * y))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
r = 0
if k >= n:
    r = (k - n) * x
else:
    r = (n - k) * y + k * x
print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
r = 0
if k >= n:
    r = k * x
else:
    r = (n-k)*y + k*x
print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N>K:
  print(K*X + (N-K)*Y)
else:
  print(K*X)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<K:
  print(K*X + (N-K)*Y)
else:
  print(K*X)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(K*X + (N-K)*Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
a = k * x
b = (n - k) * y
print(a + b)

Submission status: Wrong Answer

Solution code:
N, K, X, Y = [int(input()) for i in range(4)]

costs = [X] * N
costs[K-1:] = [Y] * len(costs[K-1:])

ans = sum(costs)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]
if n < k:
  print(n * x)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(b*c + (a-b)*d) if a >= b else print(b*c)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

sums = max(0, n - k) * y + k * x
print(sums)

Submission status: Wrong Answer

Solution code:
n,k = [int(input()) for _ in range(2)]
x,y = [int(input()) for _ in range(2)]

ans = 0
for i in range(n):
  if i <= k:
    ans += x
  else:
    ans += y
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print((k * x) + ((n - k) * y))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N <= K:
    print(N*X)
else:
    print(N*X+(N-K)*Y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N <= K:
    print(N*X)
else:
    print(N*X+(K-N)*Y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N < K:
    print(N*X)
else:
    print(N*X+(K-N)*Y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

ans = N * X + max(0, Y * (N - K))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

ans = K * X + max(0, Y * (N - K))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int( input() )
K = int( input() )
X = int( input() )
Y = int( input() )
 
if N < K + 1 :
   tot = N * X
else : 
   tot = N * K + ( N - K ) * Y
  
print( tot )

Submission status: Wrong Answer

Solution code:
N = int( input() )
K = int( input() )
X = int( input() )
Y = int( input() )

if N < K + 1 :
   tot = N * X
else : 
   tot = N * X + ( N - K ) * Y
  
print( tot )

Submission status: Wrong Answer

Solution code:

N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N <= K:
    print(X*K)
else:
    print((N-K)*Y + K*X)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]
print(k*x+(n-k)*y)

Submission status: Wrong Answer

Solution code:
K=int(input())
N=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)

Submission status: Wrong Answer

Solution code:
K=int(input())
N=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(K*X)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(k * x + max(n - k, 0) * y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print(K*X + (N - K)*Y)

Submission status: Wrong Answer

Solution code:
N, K, X, Y = [int(input()) for _ in range(4)]
print(K * X + (N - K) * Y)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
if a-b>=0:
    x=a-b
else:
    x=0
print(c*b+d*x)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(c*b+d*(a-b))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(k * x + (n - k) * y if k <= n else k * x)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(k * x + (n - k) * y)

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(input()) for i in range(4)]
print(b*c + (a-b)*d)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e=0
if b>a:
  e = a*c
if b < a:
	e= b*c
	e = e+(a-b)*d
print(e)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e= b*c
e = e+(a-b)*d
print(e)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
ans=0
for i in range(a):
    if 0<a:
        ans+=c
    else:
        ans+=d
print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x * k if k >= n else x * k + y * (n - k))

Submission status: Wrong Answer

Solution code:
from sys import stdin
from itertools import combinations

n = int(stdin.readline().rstrip())
k = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
y = int(stdin.readline().rstrip())

if n <= k:
    print(x*n)
else:
    print(x*n+y*(n-k))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print(K*X + (N-K)*Y)

Submission status: Wrong Answer

Solution code:
n,k,x,y=map(int,[input() for i in range(4)])
print(k*x+y*(n-k))

Submission status: Wrong Answer

Solution code:
n, k, x, y = map(int, list(input() for i in range(4)))
print(k*x + (n-k)*y)

Submission status: Wrong Answer

Solution code:
n, k, x, y = map(int, list(input() for i in range(4)))
print(k*x + (n-k)*y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y= int(input())

print(K*X + (N-K)*Y)

Submission status: Wrong Answer

Solution code:
w = str(input())

for i in range(len(w)):
    if w.count(w[i]) % 2 != 0:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
w = str(input())

for i in range(len(w)):
    if w.count(w[i]) % 2 == 0:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
cost = int()

if N > K+1:
     cost = K*X + (N-K)*Y
else:
    cost = N*X

print(cost)

Submission status: Wrong Answer

Solution code:
w = input()
a = True

for letter in "abcdefghijklmnopqrstuvwxyz":
    c = w.count(letter)
    if c%2 != 0:
        print("No")
        a = False

if a:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(n,k)*x + min(n-k,0)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
nk = max(0,n-k)
x = int(input())
y = int(input())

print(k*x+y*nk)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
nk = n-k
x = int(input())
y = int(input())

print(k*x+y*nk)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x*k+max(0,n-k)*y)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]

if N <= K:
    print(N * X)
else:
    S = N * X
    p = N - K
    s = p * Y
    S += s
    print(S)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]

if N <= K:
    print(N * X)
else:
    S = N * X
    s = (N - K) * Y
    S += s
    print(S)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]

if N <= K:
    print(N * X)
else:
    S = N * K
    s = (N - K) * Y
    S += s
    print(S)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]

if N <= K:
    print(N * K)
else:
    S = N * K
    s = (N - K) * Y
    S += s
    print(S)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]

if N <= K:
    print(N * K)
else:
    S = N * K
    s = N * (N - K)
    S += s
    print(S)

Submission status: Wrong Answer

Solution code:
#ABC044_A

N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N <= K:
	print(N * X)
else:
	print((N - K) * X + K * Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
a = int(input())
b = int(input())
print(a * n if k >= n else a * n + b * (k-n))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

a = 0 if N<K else N-K
cost = X*K + Y*a

print(cost)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

cost = X*K + Y*(N-K)

print(cost)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print(X*K + Y*(N-K))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
  print(k*x + (n-k-1)*y)
else:
  print(k*x)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
  print(k*x + (n-k)*y)
else:
  print(k*x)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for _ in range(4)]
result = 0
if n > k:
    print(x * k + (n-1) * y)
else:
    print(x * n)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for _ in range(4)]
print(x * k + y * (n - k))

Submission status: Wrong Answer

Solution code:
N=int(input()) 
K=int(input()) 
X=int(input()) 
Y=int(input()) 
ans = K*X + (N-K)*Y
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = min(k, n) * x
ans += min(0, n - k) * y
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n>k:
    print(x*k+y*(n-k))
else:
    print(x*k)

Submission status: Wrong Answer

Solution code:
n,k,x,y=[int(input()) for i in range(4)]
if n>k:
    print(x*k+y*(n-k))
else:
    print(x*k)

Submission status: Wrong Answer

Solution code:
def examA():
    N = I(); K = I(); X = I(); Y = I()
    sum = 0
    sum += K*X
    sum += (N-K)*Y
    ans = sum
    print(ans)


import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

ans = 0

for i in range(N):
  if i <= K:
    ans += X
  else:
    ans += Y

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if k<=n:print(x*k)
else:print(x*k+(n-k)*y)

Submission status: Wrong Answer

Solution code:
data=[]
for i in range(4):
  data.append(int(input()))

if data[0]>=data[1]:
  a=data[2]*data[0]
  b=data[3]*(data[0]-data[1])
  print(a+b)
else:
  print(data[2]*data[0])

Submission status: Wrong Answer

Solution code:
n, k, x, y = int(input()), int(input()), int(input()), int(input())

print(n*x if n>=k else k*x+(n-k)*y)

Submission status: Wrong Answer

Solution code:
n, k, x, y = int(input()), int(input()), int(input()), int(input())
print(n*y+k*(x-y))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(n*y+k*(x-y))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
s = 0
for n in range(N):
  if n <= K:
    s = s + X
  else:
    s = s + Y
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x= int(input())
y= int(input())

if n>k:
  print(k*x+(n-k)*y)

else:
  print(k*x)

Submission status: Wrong Answer

Solution code:

n = int(input())
k = int(input())
x= int(input())
y= int(input())

if n>=k:
  print(k*x+(n-k)*y)

else:
  print(k*x)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
price = K*X+ max(0,N-K)*Y
print(price)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
price = K*X+(N-K)*Y
print(price)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]
print (X * (N -K+1) + Y * (K-1))

Submission status: Wrong Answer

Solution code:
a,b,c,d=(int(input()) for i in [0]*4)
print(b*c+d*max(a-b,0))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n - k >= 0:
    print(x * k + y * (n - k))
else:
    print(x * k)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x * k + y * (n - k))

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
print(x*(3 if n>=k else n) + y*(n-k if n>=k else 0))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N >= K:
    print(N*X)
else:
    print(N*X+(N-K)*Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

ans = k*x + (n-k)*y
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N >= K:
    print(X*N)
else:
    print(X*K+Y*(N-K))

Submission status: Wrong Answer

Solution code:
N=int(input());K=int(input());X=int(input());Y=int(input());print(K*X+(N-K)*Y)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
cost=N*X-(N-K)*(max(X-Y,0))
print(cost)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
cost=K*X+(N-K)*Y
print(cost)

Submission status: Wrong Answer

Solution code:
N=int(input());K=int(input());X=int(input());Y=int(input())
s=0
if N >= K:
  for i in range(1,K+1):
    s+=X
  for i in range(K+1,N+1):
    s+=Y
else:
  for i in range(1,K+1):
    s+=X
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input());K=int(input());X=int(input());Y=int(input())
s=0
if N >= K:
  for i in range(1,K+1):
    s+=X
  for i in range(K+1,N+1):
    s+=Y
else:
  for i in  range(1,K+1):
    s+=X
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input());K=int(input());X=int(input());Y=int(input())
s=0
if N > K:
  for i in range(1,K):
    s+=X
  for i in range(K+1,N+1):
    s+=Y
else:
  for i in  range(1,K):
    s+=X
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input());K=int(input());X=int(input());Y=int(input())
a=0
if N > K:
    for i in range(1,K+1):
        a+=X
    for i in range(K,N+1):
        a+=Y

else:
    for i in range(1,N+1):
        a+=X
print(a)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]
if N <= K:
    print(K*X)
else:
    print(K*X + (N-K)*Y)

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(4)]
N=a[0]
K=a[1]
X=a[2]
Y=a[3]
print('{:.0f}'.format(K*X+max(0, N-K)*Y))

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    n = int(input())
    k = int(input())
    x = int(input())
    y = int(input())

    print(x * k + (n - k) * y)

Submission status: Wrong Answer

Solution code:
N = 3
K = 1
X = 5000
Y = 4000

sum = X + Y * 2

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]
if N > K:
  fee = K*X + Y * (N - K)
  print(fee)
else: 
  fee = K*X
  print(fee)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = [int(input()) for i in range(4)]
fee = K*X + Y * (N - K)
print(fee)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N > K:
    M = N-K
    print(K*X+M*Y)
elif K > N:
    print(N*X)

Submission status: Wrong Answer

Solution code:
N,K,X,Y=map(int,open(0));print(min(N,K)*X+min(K,N-K)*Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x*k + (n-k)*y)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())

money=(k*x)+(n-k)*y
print(money)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

cost = K * X + Y * (N - K)

print(cost)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
print(K*X+(N-K)*Y if N>=K else K*X)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
print(K*X+(N-K)*Y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = input()
y = input()

k_n = n-k

if k >= n:
    total = n*x
else:
    total = k*x + (n-k)*y
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = input()
y = input()

k_n = n-k

if k > n:
    total = x*k + k_n*y
else:
    total = x*k
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = input()
y = input()

k_n = n-k

if k_n >0:
    total = x*k + k_n*y
else:
    total = x*k
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = input()
y = input()

k_n = n-k
total = x*k + k_n*y
print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print((n-k+1)*x+(k-1)*y if n>k else n*x)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]


if n>k:
    ans = x*k+(n-k)*y
    
else:
    ans = x*k
    
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

S=X*K+Y*(N-K)

print(S)

Submission status: Wrong Answer

Solution code:
N = int(input()) #N泊する
K = int(input())
X = int(input())
Y = int(input()) #K+1泊以降

c = 0

t = N-K #この日数分はYの値段
print(X*K+Y*t)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = x*k + y*(n-k)
print(sum)

Submission status: Wrong Answer

Solution code:
input_ = [input() for i in range(4)]

N, K, X, Y = input_

acc = 0

if N >= K:
    acc = int(K) * int(X) + (int(N) - int(K)) * int(Y)
elif N < K:
    acc = int(N) * int(X)

print(acc)

Submission status: Wrong Answer

Solution code:
input_ = [input() for i in range(4)]

N, K, X, Y = input_

acc = 0

if N > K:
    acc = int(K) * int(X) + (int(N) - int(K)) * int(Y)
else:
    acc = int(N) * int(X)

print(acc)

Submission status: Wrong Answer

Solution code:
N,K,X,Y = map(int,open(0).read().split())
print(int((X*K)+(Y*(N-K))))

Submission status: Wrong Answer

Solution code:
N,K,X,Y = map(int,open(0).read().split())
print(int(X*K+Y*(N-K)))

Submission status: Wrong Answer

Solution code:
N,K,X,Y = map(int,open(0).read().split())
print(X*K+Y*(N-K))

Submission status: Wrong Answer

Solution code:
# -*- cording: utf-8 -*-
n = int(input())
k = int(input())
x = int(input())
y = int(input())
money = 0
for i in range(k):
  money += x
for i in range(n-k):
  money += y
print(money)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

print((K*X+(N-K)*Y))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
pay_sum = 0
for i in range(1, n+1):
    if i < k:
        pay_sum += y
    else:
        pay_sum += x
print(pay_sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(int(k * x + (n - k) * y))

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]
print(x * k + y * (n-k))

Submission status: Wrong Answer

Solution code:
n,k,x,y = ( int(input()) for i in range(4))
print(k*x+(n-k)*y)

Submission status: Wrong Answer

Solution code:
n,k,x,y=map(int,open(0));print([n*x,n*x+(n-k)*y][n>k])

Submission status: Wrong Answer

Solution code:
n,k,x,y=map(int,open(0));print([n*x,(n-k)*y][n<k])

Submission status: Wrong Answer

Solution code:
n,k,x,y=map(int,open(0));print([n*k,(n-k)*y][n<k])

Submission status: Wrong Answer

Solution code:
n, k, x, y = (int(input()) for i in range(4))
print(x * k + y * (n - k))

Submission status: Wrong Answer

Solution code:
a = [int(input()) for i in range(4)]
if a[0] <= a[1]:
  print(a[1] * a[2])
else:
  print(a[1] * a[2] + (a[0] - a[1]) * a[3])

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(X*N) if K < N else print(X*K + Y*(N-K))

Submission status: Wrong Answer

Solution code:
n,k,x,y=[int(input()) for i in range(4)]
if n>k:
    print(k*x+(n-k)*y)
else:
    print(k*x)

Submission status: Wrong Answer

Solution code:
n,k,x,y=[int(input()) for i in range(4)]
print(k*x+(n-k)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(k*x + (n-k)*y if n >= k else k*x)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(k*x + (n-k)*y)

Submission status: Wrong Answer

Solution code:
n,k,x,y=(int(input()) for i in [0]*4)

print((x*k) + (n-k)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print((x*k) + (n-k)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(x*k + (n-k)*y)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
if b>=a:
        print(b*c)
else:
        print((b*c)+(a-b)*d)

Submission status: Wrong Answer

Solution code:
n, k, x, y = map(int, open(0).read().split())
ans = 0
while 0 <= n:
    if n <= k:
        ans += x
    else:
        ans += y
    n -= 1
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n, k, x, y = map(int, open(0).read().split())
ans = 0
while n < 0:
    if n <= k:
        ans += x
    else:
        ans += y
    n -= 1
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
n,k,x,y = map(int,open(0))
price = 0
for i in range(n):
    if i <= k :
        price += x
    else:
        price += y
print(price)

Submission status: Wrong Answer

Solution code:
n,k,x,y = (int(input()) for i in range(4))
print(k*x + (n-k)*y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

print(N*X if N<=K else N*X+(N-K)*Y)

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(4)]
print(data[0]*data[2] if data[0] >= data[1] else data[0]*data[2]+max(0,data[0]-data[1])*data[3])

Submission status: Wrong Answer

Solution code:
data = [int(input()) for i in range(4)]
print(data[1]*data[2]+max(0,data[0]-data[1])*data[3])

Submission status: Wrong Answer

Solution code:
from collections import Counter

w = input()

char_counter = Counter()

for c in w:
  char_counter[c] += 1
  
print(char_counter)

is_beautiful = "Yes"
for c in char_counter.most_common():
  if c[1] % 2 == 1:
    is_beautiful = "No"

print(is_beautiful)

Submission status: Wrong Answer

Solution code:
from collections import Counter

w = input()

char_counter = Counter()

for c in w:
  char_counter[c] += 1
  
print(char_counter)

is_beautiful = "YES"
for c in char_counter.most_common():
  if c[1] % 2 == 1:
    is_beautiful = "NO"

print(is_beautiful)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

x_sum = 0
if n < k:
  x_sum = n * x
else:
  x_sum = k * x

y_sum = (n - k) * y

print(x_sum + y_sum)

Submission status: Wrong Answer

Solution code:
n,k,x,y=[int(input()) for i in range(4)]
print(max(n,k)*x+max((n-k),0)*y)

Submission status: Wrong Answer

Solution code:
n,k,x,y=[int(input()) for i in range(4)]
print(k*x+max((n-k),0)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(k*x +(n-k)*y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K =  int(input())
X =  int(input())
Y = int(input())
print(K*X + ((N-K)*Y))

Submission status: Wrong Answer

Solution code:
N = int(input())
K =  int(input())
X =  int(input())
Y = int(input())
print(K*X + (N-K)*Y)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n<=k:
  print(n*x)
else:
  print(n*k+(n-k)*y)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
    print(k * x + (n - k) * y)
else:
    print(k * x)

Submission status: Wrong Answer

Solution code:
n, k, x, y= [int(input()) for i in range(4)]
print((n-k)*y+(k*x))

Submission status: Wrong Answer

Solution code:
lists = list(input())
a = 0
for list in lists:
    if lists.count(list)%2 != 0:
        print("No")
        break
    else:
        a += 1
if a == len(lists):
    print("Yes")

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
x=0
for i in range(a):
  if i <= b:
    x += c
  else:
    x += d
print(x)

Submission status: Wrong Answer

Solution code:
N, K, X, Y = (int(input()) for i in range(4))
print(X*K+Y*(N-K) if N>K else X*K)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]
s = x*k+y*(n-k)
print(s)

Submission status: Wrong Answer

Solution code:
w=list(input())

dic={}

for i in w:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1

val=dic.values()
ans='Yes'
for i in val:
    if i %2 !=0:
        ans='No'
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
    cost = n*k + (n-k)*y
else:
    cost = n*x
print(cost)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n - k >= 0:
  print(k * x + (n-k) * y)
else:
  print(k * x)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

print(k * x + (n-k) * y)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(X * N + Y * max(N-K, 0))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if K > N:
  print(X * N + Y * (K-N))
else:
  print(X*N)

Submission status: Wrong Answer

Solution code:
stay = int(input())
plan_change_day =int(input())
high_price=int(input())
low_price=int(input())
 
def main():
    if stay - plan_change_day > 0:
        cost = high_price * plan_change_day + low_price * (stay - plan_change_day)
        print(int(cost))
    else:
        cost = high_price * plan_change_day
        print(int(cost))
  	    
main()

Submission status: Wrong Answer

Solution code:
stay = int(input())
plan_change_day =int(input())
high_price=int(input())
low_price=int(input())
 
def main():
  cost = high_price * plan_change_day + low_price * (stay - plan_change_day)
  print(cost)
  
main()

Submission status: Wrong Answer

Solution code:
num = [int(input()) for i in range(4)]
sum = num[1]*num[2]+(num[0]-num[1])*num[3]
print(sum)

Submission status: Wrong Answer

Solution code:
num = [int(input()) for i in range(4)]
sum = num[0]*num[2]+(num[1]-num[0])*num[3]
print(sum)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if a < b:
  print(a * c)
else:
  print((a-b) * c + b * d)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(b * d + (a-b)*c)