Advertisement
erfanul007

1216

Jan 2nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<stdio.h>
  3. #include<math.h>
  4. #include<cmath>
  5. #define pi 2*acos(0.0)
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. freopen("input.txt","r",stdin);
  11. int t,i;
  12. cin>>t;
  13. for(i=1;i<=t;i++){
  14. double r1,r2,h,p,x,r,v;
  15. cin>>r1>>r2>>h>>p;
  16. x=(h*r2)/(r1-r2);
  17. r=(r2*(p+x))/x;
  18. v=(pi*((r*r*(h+x))-(r2*r2*x)))/3;
  19. printf("Case %d: %f\n",i,v);
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement