Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- ios::sync_with_stdio;
- double h;
- double w;
- cin >> h >> w;
- if (h > w) {
- double temp = h;
- h = w;
- w = temp;
- }
- double ans = h/2.0;
- if (w/3.0 <= h && w/3 > ans) ans = w/3.0;
- if (3*h <= w) ans = h;
- cout << ans << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement