fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N, M, K;
  6. cin >> N >> M >> K;
  7. if (M = 0) {
  8. return 0;
  9. }
  10. if (N = 0) {
  11. return 0;
  12. }
  13. int x;
  14.  
  15. if (N % 2 <= M) {
  16. x = N; // aktywacja pod warunkiem
  17. }
  18.  
  19.  
  20.  
  21.  
  22. for (int i = 0; i < K; i++) {
  23. N -= x;
  24. M -= x / 2;
  25. M += x;
  26. }
  27.  
  28. cout << M << endl;
  29. return 0;
  30. }
Success #stdin #stdout 0s 5320KB
stdin
55 56 67
stdout
0