Advertisement
erfanul007

Light OJ 1216

Jan 2nd, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 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. int t,i;
  11. cin>>t;
  12. for(i=1;i<=t;i++){
  13. double r1,r2,h,p,x,r,v;
  14. cin>>r1>>r2>>h>>p;
  15. x=(h*r2)/(r1-r2);
  16. r=(r2*(p+x))/x;
  17. v=(pi*((r*r*(p+x))-(r2*r2*x)))/3;
  18. printf("Case %d: %lf\n",i,v);
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement