Skip to content

Baekjoon 10707

1. Problem

문제 확인하기

2. Solution

A = int(input())
B = int(input())
C = int(input())
D = int(input())
P = int(input())
x = A * P
if C < P:
    y = B + ((P - C) * D)
else:
    y = B
if x < y:
    print(x)
else:
    print(y)