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:
myinput = [int(x) for x in raw_input()]
n = myinput[0]
k = myinput[1]
x = myinput[2]
y = myinput[3]
total = 0
if k <= n:
    total = x * k
else:
    total = (k - n) * y + n * x
print total

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
if __name__ == '__main__':
    n = 4
    input_lines = [int(input()) for i in range(n)]
    N = int(input_lines[0])
    K = int(input_lines[1])
    X = int(input_lines[2])
    Y = int(input_lines[3])
    

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

Submission status: Wrong Answer

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

print( K*X + max((N-K),0)*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:
'''
Created on 2016/08/28

@author: diyosko7
'''
import sys
if __name__ == '__main__':
    n = 4
    input_lines = [int(input()) for i in range(n)]
    N = input_lines[0]
    K = input_lines[1]
    X = input_lines[2]
    Y = input_lines[3]

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

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:
import sys

N = int(sys.stdin.readline())
K = int(sys.stdin.readline())
X = int(sys.stdin.readline())
Y = int(sys.stdin.readline())

#X* K + Y * (N-K)
# if N > K

#X * K
# if N < K

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

Submission status: Wrong Answer

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

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

Submission status: Time Limit Exceeded

Solution code:
import time

time.sleep(2)
print(4)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def iroha():
    n, k, price, special = [int(input()) for i in range(4)]
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    print(result)

if __name__ == "__main__":
    iroha()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
ABC044 A 高橋君とホテルイージー
https://kenkoooo.com/atcoder/#/table/Tsukumo
"""

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:
#!/usr/bin/env python3

def main():
    n = int(input())
    k = int(input())
    x = int(input())
    y = int(input())
    print(n * x - (x - y) * max(n - k, 0))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
from datetime import date

def main():
	
	n = int(input())
	k = int(input())
	x = int(input())
	y = int(input())	
	
	ans = max(0, n - k) * y + min(n, k) * x;
	print(ans)

main()

Submission status: Accepted

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

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, K, X, Y = [int(input()) for _ in range(4)]
result = min(N, K)
N -= result
result *= X

if N >= 0:
  result += N * Y
print(result)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
total = int(input())
initial = int(input())
if initial > total:
  initial = total
a = int(input())
b = int(input())
count = 0
for i in range(initial):
  count+= a
for c in range(total - initial):
  count+=b

print(count)

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
if k>=n:
    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:
    total = (k * x) + (n - k) * y
    print(total)
else:
    total = n * x
    print(total)

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = min(n, k) * x
n -= min(n, k)

ans += n * y

print(ans)

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

if N > K:
    for i in range(0, K):
        ans += X
    for i in range(K, N):
        ans += Y
elif N <= K:
    for i in range(0, N):
        ans += X

print(ans)

Submission status: Accepted

Solution code:
class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fac = [1 for i in range(self.n + 1)]
        self.finv = [1 for i in range(self.n + 1)]
        for i in range(2, self.n+1):
            self.fac[i] = (self.fac[i - 1] * i) % self.mod
            self.finv[i] = (self.finv[i-1] * pow(i, -1, self.mod)) % self.mod

    def comb(self, n, m):
        return self.fac[n] * (self.finv[n-m] * self.finv[m] % self.mod) % self.mod
def iparse():
    return list(map(int, input().split()))

if __name__ == "__main__":
    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,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 = 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(N, K) * X + max(N - K, 0) * Y)

Submission status: Accepted

Solution code:
import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque 

input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))

INF = 1001001001

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

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N = ini()
K = ini()
X = ini()
Y = ini()

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

if k > n:
    k = n

a = int(input())
b = int(input())

total = 0

for i in range(1,k+1):
    total += a

for j in range(k,n):
    total += b
    
print(total)

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,k,x,y=int(input()),int(input()),int(input()),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())
fees=0
if(k>n or n==k):
	for i in range(0,n):
		fees+=x
elif(k<n):
	diff=n-k
	for j in range(0,k):
		fees+=x
	for k in range(0,diff):
		fees+=y
		
print(fees)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(cost)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def main():
    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)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

if K<N:
  print((N-K)*y + K*x)
  
else:
  print(N*x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 044_a
# A - 高橋君とホテルイージー

N = int(input())  # 連泊数
K = int(input())  # 料金変動泊数
X = int(input())  # 通常価格
Y = int(input())  # 変動価格

if ((1 <= N & N <= 10000) & (1 <= K & K <= 10000)) \
        & (1 <= X & X <= 10000) & (1 <= Y & Y <= 10000):
    if (X > Y):
        price = 0
        if (N < K):
            for i in range(1, N + 1):
                price += X
        if (N >= K):
            for i in range(1, K + 1):
                price += X
            for j in range(K + 1, N + 1):
                price += Y
        print(price)

Submission status: Accepted

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

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:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    k = I()
    x = I()
    y = I()
    if n <= k:
        print(n*x)
    else:
        print(k*x + (n-k)*y)

if __name__ == '__main__':
    main()

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:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    K = int(readline())
    X = int(readline())
    Y = int(readline())

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 数値の取得
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

# 宿泊費の計算後結果を出力
if N <= K:
  account = N * X
else:
  account = (K * X) + (max(N - K,0) * Y) 
  
print(account)

Submission status: Accepted

Solution code:
N = int(input())    # N泊
K = int(input())    # 最初のK泊までは1泊当たりX円
X = int(input())
Y = int(input())    # K+1泊目以降は1泊当たりY円

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

print(total)

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)*y, 0))

Submission status: Accepted

Solution code:
# abc044_a
# https://atcoder.jp/contests/abc044/tasks/abc044_a

# 最初のK泊までは、X円
# K＋1泊目以降は、Y円

# N泊連続で宿泊した際の宿泊費

# 入力
n = int(input())
k = int(input())
x = int(input())
y = int(input())

# 処理

# x円とy円
if n > k:
    answer = k * x + (n - k) * y
# x円のみ
else:
    answer = n * x

print(answer)

Submission status: Accepted

Solution code:
import sys
N, K, X, Y = map(int, sys.stdin.readlines())
print(N*X if N <= K else K*X +Y*(N-K))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
cost = 0
if n > k:
    for i in range(k):
        cost += x

    for j in range(k, n):
        cost += y
    print(cost)

elif n <= k:
    for i in range(n):
        cost += x
    print(cost)

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)
elif n <= k:
  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+1<=k):
        ans += x
    if(i+1>k):
        ans += 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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 最初のK泊までは、1泊あたりX円
# K+1泊目以降は、1泊あたりY円
# N泊したときの宿泊費

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 1 軒のホテルがあります。 このホテルの宿泊費は、次のようになっています。
# 最初の K 泊までは、 1 泊あたり X 円 K + 1 泊目以降は、 1 泊あたり Y 円 高橋君は、このホテルに N 泊連続で宿泊することにしました。
# 高橋君の宿泊費は合計で何円になるか求めてください。

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

if N - K >= 1:
    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 >= 1:
    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())

x_days = min(n, k)
y_days = n - x_days

print(x * x_days + y * y_days)

Submission status: Accepted

Solution code:
stay = int(input())
days = int(input())
charge1 = int(input())
charge2 = int(input())
charge_total = 0

for i in range(stay):
    temp = i + 1
    if temp <= days:
        charge_total += charge1
    else:
        charge_total += charge2
print(charge_total)

Submission status: Accepted

Solution code:
n,k,x,y=[int(input())for i in [0]*4]
ans=0
ans+=min(k,n)*x
n-=min(k,n)
print(ans+y*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:
# 1軒のホテルがあります。 このホテルの宿泊費は、次のようになっています。
# ・最初の K泊までは、1泊あたり X円
# ・K + 1 目以降は、1泊あたり Y円
# 高橋君は、このホテルに N泊連続で宿泊することにしました。
# 高橋君の宿泊費は合計で何円になるか求めてください。

# 制約
# 1 ≤ N, K ≤ 10000
# 1 ≤ Y < X ≤ 10000
# N, K, X, Y はいずれも整数である

# 標準入力から、N, K, X, Yを取得する
input_n = int(input())
input_k = int(input())
input_x = int(input())
input_y = int(input())

# 宿泊費を計算して出力する
result = 0

for i in range(input_n):
    if i < input_k:
        result += input_x
    else:
        result += input_y

print(result)

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

# NがK以下ならN泊×X円、NがKより大きいなら(K泊×X円)+((N-K)×Y円)
if N <= K:
    print(N * X)
elif N > K:
    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(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:
    yen1 = K * X
    yen2 = (N - K) * Y
    print(yen1 + yen2)
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+1 <= k:
        ans += x
    else:
        ans += y
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

sum_num = 0
for i in range(1, N + 1):
    if i > K:
        sum_num += Y
    else:
        sum_num += X

print(sum_num)

Submission status: Accepted

Solution code:
# A - 高橋君とホテルイージー
# https://atcoder.jp/contests/abc044/tasks/abc044_a

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, K, X, Y = [int(input())for i in range(4)]

# 処理
S = int()
# S = K * X + (N - K) * Y
if N > K:
    S = K * X + (N - K) * Y
else:
    S = N * X

# 出力
print(S)

Submission status: Accepted

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

total = (K * X) + (N - K) * Y
goukei = N * X

if N < K:
    print(goukei)
else:
    print(total)

Submission status: Accepted

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

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

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())    # 単価a
Y = int(input())    # 単価b


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

print(a)

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)

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+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 = int(raw_input())
k = int(raw_input())
p = int(raw_input())
q = int(raw_input())
print p * min(k,n) + max(n - k,0) *q

Submission status: Accepted

Solution code:
#宿泊数N,金額を表す計算用宿泊日数K,K泊目の金額X,K+1泊目の金額
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

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

print(a+b)

Submission status: Accepted

Solution code:
# 入力
total_days = int(input())
days_normal_price = int(input())
normal_price = int(input())
discount_price = int(input())

# 処理
if total_days <= days_normal_price:
    answer =total_days * normal_price
    print(answer)
elif total_days > days_normal_price:
    first = normal_price * days_normal_price
    second = (total_days - days_normal_price) * discount_price
    answer = first + second
    print(answer)

Submission status: Accepted

Solution code:
# 044a

N = int(input())    # 宿泊数Nを代入
K = int(input())    # 最初のK泊を代入
X = int(input())    # K泊までの一泊あたりの料金Xを代入
Y = int(input())    # K+1泊目以降の一泊あたりの料金Yを代入

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

print(hotel_fee)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#   AtCoder abc044 a
#   ストレッチ課題

#   入力
n = int(input())    # 宿泊数
k = int(input())    # 単価が切り替わる泊数
x = int(input())    # 単価a
y = int(input())    # 単価b

#   処理
if n <= k:
    fee = n * x
else:
    fee = k * x + (n - k) * y

#   出力
print(fee)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
border = int(input())
first = int(input())
second = int(input())

if num <= border:
    price = num*first
else:
    price = border*first
    price += (num - border)*second
    
print(price)

Submission status: Accepted

Solution code:
# 044A

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

Submission status: Accepted

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

total_payment = 0

for i in range(1, n + 1):
    if i <= k:
        total_payment += x
    else:
        total_payment += y

print(total_payment)

Submission status: Accepted

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

total_payment = 0

for i in range(1, n + 1):
    if i <= k:
        total_payment += x
    else:
        total_payment += y

print(total_payment)

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

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

Submission status: Accepted

Solution code:
# A - 高橋君とホテルイージー

# 1軒のホテルがあります。 このホテルの宿泊費は、次のようになっています。

# 最初の K 泊までは、1 泊あたり X 円
# K+1 泊目以降は、1 泊あたり Y 円

# N = 高橋くんの宿泊日数
# K = 割引なしの宿泊日数
# X = 割引なしの宿泊料
# Y = 割引後の宿泊料


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:
total_stay = int(input())
normal_stay = int(input())
normal_cost = int(input())
discounted_cost = int(input())
if total_stay <= normal_stay:
  total_cost = total_stay * normal_cost
else:
  total_cost = normal_stay * normal_cost + (total_stay - normal_stay) * discounted_cost
print(total_cost)

Submission status: Accepted

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

# K泊分 = K * X
# K泊分以降 = (N - K) * Y

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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