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())
k = int(input())
x = int(input())
y = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N<=K:
    Ans=K*X
else:
    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*N + (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:
a=int(input())
b=int(input())
c=int(input())
d=int(input())

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

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,K,X,Y=[int(input()) for i in range(4)]
#print(N,K,X,Y)
if N <= K:
  cost = K * X
else:
    cost = K * X + (N-K) * Y
print(cost)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k,x,y=int(input()),int(input()),int(input()),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(X*K+Y*(N-K))
elif N <= K:
  print(X*K)

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))
elif N <= K:
  print(X*K)

Submission status: Wrong Answer

Solution code:
n,k,x,y = int(input()),int(input()),int(input()),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())
ans=0
for i in range(K):
    ans+=X
for j in range(N-K):
    ans+=Y
print(ans)

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())
 
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())
 
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())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
ans=0
if N<K:
    print(X*N)
else:
    ans+=X*K
    for i in range(N-K):
        ans+=Y
print(ans)

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())
money = 0

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

elif N-K < 0:
    money += (N*X)
    print(money)

Submission status: Wrong Answer

Solution code:
w = str(input())
count = 1
for i in range(len(w)):
    s = w.count(w[i])
    if s % 2 != 0:
        print("No")
        count -=1
if count == 1:
    print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input()) 
K = int(input())
X = int(input())
Y = int(input())
if N <= K:
  print(K * X)
else:
  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(int(x*k+y*(n-k)))

Submission status: Wrong Answer

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

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(N*K)

Submission status: Wrong Answer

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

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 > 0 else 0))

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=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
  print(X*K+Y*(N-X))
else:
  print(X*N)

Submission status: Wrong Answer

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

def price(N, K, X, Y):
    if N < K:
        return N * X
    else:
        return N * X + (N-K) * Y

print(price(N, K, X, Y))

Submission status: Wrong Answer

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

def price(N, K, X, Y):
    if N < K:
        return N * X
    else:
        print("exceed", K, X, K * X + (N-K) * Y)
        return N * X + (N-K) * Y

print(price(N, K, X, Y))

Submission status: Wrong Answer

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

cnt = 0
for i in range(N):
  if(i < 3):
    cnt += X
  else:
    cnt += Y
print(cnt)

Submission status: Wrong Answer

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

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:
n, k, x, y = [int(input()) for _ in range(4)]
print(k * x + (n-k-1) * y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int( input())
K = int( input())
X = int( input())
Y = int( input())
if N <= X:
    print(N*X)
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())
if n<=k:
  payment=x*k
else:
  payment=x*k+y*(n-k)
print(int(payment))

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())

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

Submission status: Wrong Answer

Solution code:
N = input()
K = input()
X = input()
Y = input()
print N * X if X <= K else 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 <= 0 : # 宿泊日数nがk泊よりも多いかどうか
    print(n * x) # 宿泊日数のほうが少なければ単純に掛ければいい
else:
    print((x * (n - k + 1)) + (y * (n - k))) # k泊目まではx円、それ以降はy円、k泊目はx円だから1足すことに注意

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())

summary = 0

summary += K * X

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

Submission status: Wrong Answer

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

summary = 0

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

print(summary)

Submission status: Wrong Answer

Solution code:
from collections import Counter

num=Counter(input())
for X in num.values():
    if X%2!=0:
        print("NO")
        break
else:
    print("YES")

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())
sum = 0
sum += k * x
sum += (n-k) * y
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N > K:
    print(X * K + (N - K) * Y)
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 + (N - K) * Y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lat = 0 if N < K else N - K

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

Submission status: Wrong Answer

Solution code:
N = input()
K = input()
X = input()
Y = input()
if(X < Y):
	tmp = X
	X = Y
	Y = tmp

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = input()
K = input()
X = input()
Y = 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*K)
else:
    print((K)*X+(N-K)*Y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
days_to_stay = int(input())
special_days = int(input())
special_price = int(input())
normal_price = int(input())
payment = 0 

if days_to_stay <= special_days:
    payment = days_to_stay * special_price
else:
    payment = (days_to_stay - special_days) * normal_price + days_to_stay * special_price
    
print(payment)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n <= k:
  print(x*2)
else:
  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 N*K)

Submission status: Wrong Answer

Solution code:
A = int(input())
#print(A)
B = int(input())
#print(B)
C = int(input())
#print(C)
D = int(input())
#print(D)
K = A - B
#print(K)
#print()

if K > 0:           #Kが正のとき
    mae = (B * C)
    #print(mae)
    ato = K * D
    #print(ato)
    print(mae + ato)
    
    
elif K < 0:         #Kがマイナスのとき
    print(A * C)

Submission status: Wrong Answer

Solution code:
n,k,x,y = map(int,open(0).read().split())
if n>k:
    print(n*x + (n-k)*y)
else:
    print(n*x)

Submission status: Wrong Answer

Solution code:
n,k,x,y = map(int,open(0).read().split())
if n>k:
    print(k*x + (n-k)*y)
else:
    print(k*x)

Submission status: Wrong Answer

Solution code:
n,k,x,y = map(int,open(0).read().split())
if n>=k:
    print(k*x + (n-k)*y)
else:
    print(k*x)

Submission status: Wrong Answer

Solution code:
n,k,x,y = map(int,open(0).read().split())

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

Submission status: Wrong Answer

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

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())

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

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(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)+Y)
else:
  print(N*X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding;utf-8
n=[]
for i in range(4):
  n.append(int(input()))
m=0
if(n[0]-n[1]<0):
  m=0
else:
  m=n[0]-n[1]
print(n[2]*n[1]+n[3]*m)

Submission status: Wrong Answer

Solution code:
#coding;utf-8
n=[]
for i in range(4):
  n.append(int(input()))
m=0
if(n[0]-n[1]<0):
  m=0
else:
  m=n[0]-n[1]
print(n[2]*n[0]+n[3]*m)

Submission status: Wrong Answer

Solution code:
#coding;utf-8
n=[]
for i in range(4):
  n.append(int(input()))
m=0
if(n[0]-n[1]<0):
  m=0
else:
  m=n[0]-n[1]
print(n[2]*n[1]+n[3]*m)

Submission status: Wrong Answer

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

if K >= N:
    a = N * X
    print(a)

else:
    a = K + X
    b = (N - K) * Y
    print(a + b)

Submission status: Wrong Answer

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

if K > N:
    a = N * X
    print(a)

else:
    a = K + X
    b = (N - K) * Y
    print(a + b)

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:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)*c+max(b-a,0)*d)

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+(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(x*n)
else:
  print(x*n+(k-n)*y)

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())
if n >= k:
    total = n*x
else:
    total = k*x + (n-k)*y
print(total)

Submission status: Wrong Answer

Solution code:
n = input()
k = input()
x = input()
y = input()
N = int(n)
K = int(k)
X = int(x)
Y = int(y)
if N >= K:
    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=int(input())
y=int(input())
ans=0
for i in range(n):
    if n>k:
        ans+=y
    else:
        ans+=x
print(ans)

Submission status: Wrong Answer

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

#print(a)
#print(a[0],a[1],a[2],a[3])
if a[1] > a[0]:
  a[1] = 0
  
sum = a[1]*a[2] + a[3]*(a[0]-a[1]) 
print(sum)

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-k+1)*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,k,x,y = [int(input()) for _ in range(4)]
print(x*min(n,k)+y*max(0,k-n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def inpn(): return int(input())
N, K, X, Y = inpn(), inpn(), inpn(), inpn()
if K <= N:
    print(K*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(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((n*x) + (n-k)*(y-x))

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(X*K+Y*(N-K))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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("N:"))
K = int(input("K:"))
X = int(input("X:"))
Y = int(input("Y:"))
if 1 <= N and K <= 10000 and 1 <= Y < X <= 10000 :
    S = (X * K) + (Y *(N - K))
else :
    pass
print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
sum = 0
for i in range(1,N+1):
  if i <=K:
    sum += X
  else:
    sum += Y

Submission status: Wrong Answer

Solution code:
def check_w(arr):
    a = 0
    for i in range(len(arr)-1):
        a += 1
        if arr[i] != arr[i+1]:
            if a % 2 != 0:
                return False
            a = 0
    return True

w = list(input())
w.sort()
if check_w(w):
    print("Yes")
else:
    print("No")

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())
f=0
for i in range(n-k+1):
  f+=x
for i in range(k-1):
  f+=y
print(f)

Submission status: Wrong Answer

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

r = (k*x) + ((n-k)*y)

print (r)

Submission status: Wrong Answer

Solution code:
n, k, x, y = [int(input()) for i in range(4)]
if n <= k: print(x*n)
else: print(x*n + max(0, 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())
i = n - k
print(k * x + y * i)

Submission status: Wrong Answer

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

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:
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(str, stdin.readline().split()))
def readAll_str(): return list(map(str, stdin))
def readLine_int_set(): return set(list(map(int, stdin.readline().split())))
def g_twoD_list(p,q): return [[0 for i in range(p)] for j in range(q)]


def main():
    n,k,x,y = readAll_int()
    print(k*x + (n-k)*y)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 = int(input())
K = int(input())
X = int(input())
Y = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
print('No' if any(char[1]%2 for char in Counter(input()).items()) else 'Yes')

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(int(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 - (K - 1)) * X + (K - 1) * Y)
else:
    print(N * X)

Submission status: Wrong Answer

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

if K>N:
  print(K*X)
else:
  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:
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding:utf-8
import os, sys
import math

N = input()
K = input()
X=input()
Y=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())
ans = 0

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

Submission status: Wrong Answer

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






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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# problem A

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
k = int(input())
x = int(input())
y = int(input())

def main():
    if n <= k:
        sum = (k * x) + ((n - k) * y)
    else:
        sum = (n * x)
    return sum

print(main())

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
k = int(input())
x = int(input())
y = int(input())

def main():
    if n < k:
        sum = (k * x) + ((n - k) * y)
    else:
        sum = (n * x)
    return sum

print(main())

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
k = int(input())
x = int(input())
y = int(input())

def main():
    sum = (k * x) + ((n - k) * y)
    return sum

print(main())

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:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 火 11/ 8 16:49:06 2016

# Usage
#
"""
def read_input():
    N = int(input())
    K = int(input())
    X = int(input())
    Y = int(input())

    return N, K, X, Y


def check_sum(N, K, X, Y):
    """
    >>> check_sum(5, 3, 10000, 9000)
    48000
    >>> check_sum(2, 3, 10000, 9000)
    20000
    """
    if N > K:
        return K * X + (N-K)*Y
    else:
        return N * X


if __name__ == "__main__":
    # import doctest
    #
    # doctest.testmod()
    N, K, X, Y = read_input()

    check_sum(N, K, X, Y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 火 11/ 8 16:49:06 2016

# Usage
#
"""
def read_input():
    N = int(input())
    K = int(input())
    X = int(input())
    Y = int(input())

    return N, K, X, Y


def check_sum(N, K, X, Y):
    """
    >>> check_sum(5, 3, 10000, 9000)
    48000
    >>> check_sum(2, 3, 10000, 9000)
    20000
    """
    if N > K:
        return K * X + (N-K)*Y
    else:
        return N * X


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    N, K, X, Y = read_input()

    check_sum(N, K, X, Y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    n, k, x, y = [read() for _ in range(4)]
    print(k*x + (n-k)*y)

main()

Submission status: Wrong Answer

Solution code:
def B(w,arpha,count):
    for c in w:
        for i,a in enumerate(arpha):
            if c == a:
                count[i]+=1

    for i in count:
        if  i % 2 != 0:
            return print("No")
    print("Yes")

w = input()
arpha = [chr(i) for i in range(97,97+26)]
count = [0 for i in range(26)]
B(w,arpha,count)

Submission status: Wrong Answer

Solution code:
line = raw_input()

c = 'a'
flg = 'Yes'

for i in range(0, 26):
    c = chr(ord(c) + 1)
    if line.count(c) % 2 == 1:
        flg = 'No'
        break

print flg

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(put[2] * put[1] + put[3] * (put[0] - put[1]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

w = list(input())
w.sort()

isBeautiful = True
length = len(w)
for i in range(0, length, 2):
  if w[i] is not w[i + 1]:
    isBeautiful = False
    break

print('Yes' if isBeautiful else 'No')

Submission status: Wrong Answer

Solution code:
w = input()


hist = dict()
for char in w:
  if not char in hist.keys():
    hist[char] = 1
  else:
    hist[char] += 1

answer = True
for value in hist.values():
  if value % 2 == 1:
    answer = False

if answer:
  print ('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

N = input_list[0]
K = input_list[1]
X = input_list[2]
Y = input_list[3]

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

print ( result )

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

w = input()

chars = "abcdefghijklmnopqrstuvwxyz"

for x in chars:
    if w.count(x) % 2 != 0:
        print("No")
        break
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
# -*- encoding: utf-8 -*-

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 = input()
k = input()
x = input()
y = 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(x*k + y*(n - k))
else:
    print(x*k)

Submission status: Wrong Answer

Solution code:
str = input()
str_set = set(str)

for x in str_set:
    c = str.count(x)
    if c % 2 == 1:
        print('No')
        exit()

print('Yes')

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:
import sys
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

M = 0
if K > M:
	for i in range(N):
		M += X
	print(M)
	sys.exit()
for i in range(K):
	M += X
for i in range(N-K):
	M += Y

print(M)

Submission status: Wrong Answer

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

M = 0
for i in range(K):
	M += X
for i in range(N-K):
	M += Y

print(M)

Submission status: Wrong Answer

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

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