| //https://www.acmicpc.net/problem/10707 #include <iostream> |
| using namespace std; |
| int main() |
| { |
| int a,b,c,d,p; |
| cin >>a >> b >> c>> d>> p; |
| int costx=a*p; |
| int costy=(p>c ?b+d*(p-c) :b ); |
| if(costx>costy) cout << costy; |
| else cout << costx; |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 180106_3143_가장 빠른 문자열 타이핑 (0) | 2018.01.06 |
|---|---|
| 180106_2914_저작권 (0) | 2018.01.06 |
| 180104_13116_30번 (0) | 2018.01.04 |
| 180103_TRIANGLEPATH (0) | 2018.01.03 |
| 180102_2884_알람 시계 (0) | 2018.01.02 |