StoneHaos

702

Nov 3rd, 2019
159
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //702
  2. #include <cstdio>
  3.  
  4. int main(void) {
  5.     freopen("input.txt", "r", stdin);
  6.     freopen("output.txt", "w", stdout);
  7.  
  8.     int s, c1, c2, p;
  9.     scanf("%d%d%d%d", &s, &c1, &c2, &p);
  10.     if (p > s)
  11.         printf("%d\n", s * c1 + (p - s) * c2);
  12.     else
  13.         printf("%d\n", p * c1);
  14.     return 0;
  15. }
RAW Paste Data