Advertisement
hsiuyee

Problem A. Area and Circumference

Jun 8th, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define fastio ios::sync_with_stdio(false),cin.tie(0);
  5. #define pll pair<ll,ll>
  6. #define F first
  7. #define S second
  8. #define pb push_back
  9. #define ppb pop_back()
  10. #define mkp make_pair
  11. #define sz(a) (ll)a.size()
  12. #define all(x) x.begin(),x.end()
  13.  
  14. const ll MAXN=2e5+5;
  15. const ll INF=1e18;
  16. const ll MOD=998244353;
  17.  
  18. ll N;
  19.  
  20. void init(){
  21.     cin>>N;
  22.     ll a,b,c,d;
  23.     double ans=0;
  24.     while(N--){
  25.         cin>>a>>b>>c>>d;
  26.         double h=c-a;
  27.         double w=b-d;
  28.         double tmp=(h*w)/double(2*(h+w));
  29.         ans=max(ans,tmp);
  30.     }
  31.     printf("%1f\n",ans);
  32. }
  33.  
  34. void solve(){
  35.    
  36. }
  37.  
  38. signed main(){
  39.     fastio 
  40.     freopen("area.in","r",stdin);
  41.     freopen("area.out","w",stdout);
  42.     // ll T;
  43.     // cin>>T;
  44.     // while(T--){
  45.         init();
  46.         solve();
  47.     // }
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement