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: Accepted

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

v = N - K
if 0 > v:
    r = N * X
else:
    # K < N
    r = K * X
    r += v * Y

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
k = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
y = int(stdin.readline().rstrip())
if n>k:
  print(k*x+(n-k)*y)
else:
  print(n*x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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*x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
k = ni()
x = ni()
y = ni()

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

Submission status: Accepted

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

pay = 0

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

print(pay)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
max_day, normal_day, pay, discount_pay = [int(input()) for _ in range(4)]
payment = 0

for i in range(max_day):
    if i < normal_day:
        payment += pay
    else:
        payment += discount_pay

print(payment)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 044 A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if K >= N:
    ans = N * X
elif N > K:
    ans = K * X
    ans +=(N-K)* Y

print( ans )

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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*n)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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*X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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*n)

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict, deque

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

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

print(ans)

Submission status: Accepted

Solution code:

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

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
from collections import Counter, defaultdict, deque

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)
print()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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(a*c)

Submission status: Accepted

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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*n)

Submission status: Accepted

Solution code:
""" AtCoder """

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: Accepted

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(n*x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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 * x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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(n*x)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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 * n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def execute(n, k, x, y):
    return x * min(n, k) + y * max(0, n - k)


if __name__ == '__main__':
    n = int(input())
    k = int(input())
    x = int(input())
    y = int(input())
    print(execute(n, k, x, y))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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(n * x)

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

stay_k = n if k > n else k
stay_after = (n - k) if n > k else 0

print(stay_k * x + stay_after * y)

Submission status: Accepted

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 * n)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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*n)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K, X, Y = [int(input()) for x in range(4)]
cost = 0
for x in range(1, N+1):
    if x <= K:
        cost += X
    else:
        cost += Y
print(cost)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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: Accepted

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

sum = 0
if N <= K:
    print(X*N)
elif N > K:
    print(X*K+(N-K)*Y)
#ok

Submission status: Accepted

Solution code:

a = int(input())
b = int(input())
c = int(input())
d = int(input())

s = 0
for i in range(a):
    if i < b:
        s += c
        continue
    s += d
print(s)

Submission status: Accepted

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


def main():
    """Function."""
    n = int(input())
    k = int(input())
    x = int(input())
    y = int(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math

#x = input().split()
#y = input().split()


x = int(input())
y = int(input())
z = int(input())
a = int(input())
#for i in range(len(x)):
#   a.append(int(x[i]))
if x <= y: print(x*z)
else :print(y*z+(x-y)*a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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: Accepted

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

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

Submission status: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
x_day = min( [n,k] )
y_day = max( [0,n-k])
print( x*x_day + y*y_day )

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N, K, X, Y = [int(input()) for _ in range(4)]

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


main()

Submission status: Accepted

Solution code:
def main(n,k,x,y):
	if n<=k:
		return print(n*x)
	else:
		return print(k*x + (n-k) *y)

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

main(n,k,x,y)

Submission status: Accepted

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: Accepted

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 * k) + (y * (n - k))) # k泊目まではx円、それ以降はy円

Submission status: Accepted

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: Accepted

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

summary = 0

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

print(summary)

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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])*a[3])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(min([N, K]) * X + ((N-K) * Y if N-K >= 0 else 0))