Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main()
- {
- int test;
- cin>>test;
- for(int t=1;t<=test;t++)
- {
- double r1,r2,h,p,v;
- cin>>r1>>r2>>h>>p;
- r1=r2+((r1-r2)/h)*p;
- v=(2*acos(0.0)*p*(r1*r1+r1*r2+r2*r2))/3;
- cout<<"Case "<<t<<": "<<setprecision(9)<<fixed<<v<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment