https://swexpertacademy.com/main/code/problem/problemDetail.do
T = int(input())
for test_case in range(1, T + 1):
P,Q,R,S,W = map(int,input().split())
A = W*P
B = Q
if W>R:
B += (W-R)*S
print('#%d'%test_case,min(A,B))
'Algorithm > [SWEA] - Python' 카테고리의 다른 글
[SWEA/D3] 16800 : 구구단 걷기 python (0) | 2023.09.09 |
---|---|
[SWEA/D4] 2819 : 격자판의 숫자 이어 붙이기 python (0) | 2023.09.09 |
[SWEA/D3] 13218 : 조별과제 python (0) | 2023.09.08 |
[SWEA/D2] 1288 : 새로운 불면증 치료법 python (0) | 2023.09.07 |
[SWEA/D2] 1948 : 날짜계산기 python (0) | 2023.09.05 |