SHARE
TWEET

Untitled

a guest Nov 15th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const double pi=3.14159265359;
  6.  
  7. int main()
  8. {
  9.     ios::sync_with_stdio(false);
  10.     cin.tie(0);
  11.     cout.tie(0);
  12.     double a,b,z;
  13.     cin>>a>>b>>z;
  14.     if(z==90) {cout<<fixed<<setprecision(3)<<b*a*sqrt(2); return 0;}
  15.     z=z*pi/180;
  16.     double a1=a*sqrt(2.0);
  17.     double a2=2*(a*sqrt(2.0)/2-(b*cos(z)/sin(z)));
  18.     a2=max(0.0,a2);
  19.     double h0=min(b/sin(z),(a1/2)/cos(z));
  20.     cout<<fixed<<setprecision(3)<<(a1+a2)/2*h0;
  21.  
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top