fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b, c;
  7. cin >> a >> b >> c;
  8. int minFloor = min(min(a, b), c);
  9. int maxFloor = max(max(a, b), c);
  10. int middleFloor = a + b + c - minFloor - maxFloor;
  11. int resultFloor;
  12. if(31 * (maxFloor - minFloor) < 47 * (middleFloor - minFloor)){
  13. resultFloor = minFloor;
  14. }
  15. else{
  16. resultFloor = middleFloor;
  17. }
  18. cout << resultFloor;
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 4508KB
stdin
1 5 8
stdout
5