|
|
вернуться в форумwhy WA on test#6 !!!!!!!help #include<iostream> #include<fstream> #include<sstream> #include<vector> #include<cmath> #include<queue> #include<string> #include<iomanip> using namespace std; int main(){ //1084 double glength,r; double pi = 3.1415926535897932384626433832795; cin>>glength>>r; cout<<setiosflags(ios::fixed)<<setiosflags(ios::showpoint)<<setprecision(3); if(glength >= r * 2.0){ cout<<r*r*pi<<endl; return 0; } if(glength * pow(2.0,0.5) <= r){ cout<<glength*glength<<endl; return 0; } else{ double d = pow((pow(r,2.0) - pow(glength/2.0,2.0)),0.5); double area = glength/2.0 * d/2.0; double arc = pi/4.0 - acos(0.5*glength/r); cout<< 8.0*(0.5*arc*r*r+area)<<endl; return 0; } } |
|
|