Created
November 11, 2016 14:43
-
-
Save whatalnk/1cdee12bbd865991e1c177d3fcd53dad to your computer and use it in GitHub Desktop.
AtCoder ABC #044 A [C++]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int n, k, x, y; | |
cin >> n >> k >> x >> y; | |
int ret; | |
if (n <= k){ | |
ret = n * x; | |
} else { | |
ret = k * x + (n - k) * y; | |
} | |
cout << ret << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment