Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // B
- #include <bits/stdc++.h>
- using namespace std;
- #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- #define ll long long
- #define ld double
- #define llu long long unsigned
- int main()
- {
- fast;
- int t;
- // cout<<fixed<<setprecision(10)<<acos(-1)<<endl;
- cin>>t;
- int count = 0;
- while( t-- )
- {
- ld m , d;
- cin>>m>>d;
- ld v = m / d;
- ld radius = v / (4.0/3.0 * acos(-1));
- radius = pow( radius , 1.0/3.0 );
- cout<<"Case "<<++count<<": "<<fixed<<setprecision(4)<<4.0*acos(-1)*pow( radius , 2 )<<endl;
- }
- return 0;
- }
- // C
- #include <bits/stdc++.h>
- using namespace std;
- #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- #define ll long long
- #define ld double
- #define llu long long unsigned
- int main()
- {
- fast;
- int t;
- cin>>t;
- int count = 0;
- while( t-- )
- {
- ld r;
- cin>>r;
- ld radius1 = sqrt(r*r + r*r)/2;
- // cout<<radius1<<endl;
- ld radius2 = sqrt(radius1*radius1 + radius1*radius1)/2;
- // cout<<radius2<<endl;
- ld overall = acos(-1) * pow( radius2 , 2 ) * 0.5;
- ld quarter1 = acos(-1) * pow( radius1 , 2 ) / 4;
- ld extras = quarter1 - radius1 * radius1 * 0.5;
- cout<<"Case "<<++count<<": ";
- cout<<fixed<<setprecision(4)<<overall-extras<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement