fork(7) download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6. int N, price;
  7. cin >> N;
  8. if (N % 100 > 65)
  9. price += (N / 100 + 1) * 100;
  10. else
  11. {
  12. int a = N % 100;
  13. price += (N/100) * 100;
  14. if (a % 20 > 15)
  15. price += (a / 20 + 1) * 30;
  16. else
  17. {
  18.  
  19. int b = (a % 20);
  20. price += (a / 20) * 30;
  21. price += b*2;
  22. }
  23. }
  24. cout << price;
  25. return 0;
  26. }
Success #stdin #stdout 0s 3416KB
stdin
123
stdout
136