fork download
  1. #include<iostream>
  2. #include<cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. cout.precision(4);
  9. double h, w = 0;
  10. cin >> h;
  11. cin >> w;
  12. double b = max(h, w);
  13. double a = min(w, h);
  14. double c = min(a, max(b/3, a/2));
  15. cout << fixed << c;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
8 3
stdout
2.6667