fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. long long n, m, k;
  6. cin >> n, m, k;
  7. if (n == 0 || k == 0 || (n == 0 && k == 0))
  8. {
  9. cout << 0;
  10. }
  11.  
  12. else if (n > 0 && k > 0)
  13. {
  14. if (n != 0 && (n >= (2 * k))) cout << k;
  15. if (n != 0 && (n >= (2 * k)) && m >= k) cout << k;
  16. if (n == m == k != 0) cout << k;
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5320KB
stdin
90
24
89
stdout
Standard output is empty