Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. ios::sync_with_stdio;
  7.  
  8. double h;
  9. double w;
  10. cin >> h >> w;
  11.  
  12. if (h > w) {
  13. double temp = h;
  14. h = w;
  15. w = temp;
  16. }
  17.  
  18. double ans = h/2.0;
  19. if (w/3.0 <= h && w/3 > ans) ans = w/3.0;
  20. if (3*h <= w) ans = h;
  21.  
  22. cout << ans << "\n";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement