jakaria_hossain

lightoj - 1216 - Juice in the Glass

Aug 22nd, 2019
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6. int test;
  7. cin>>test;
  8. for(int t=1;t<=test;t++)
  9. {
  10. double r1,r2,h,p,v;
  11. cin>>r1>>r2>>h>>p;
  12. r1=r2+((r1-r2)/h)*p;
  13. v=(2*acos(0.0)*p*(r1*r1+r1*r2+r2*r2))/3;
  14. cout<<"Case "<<t<<": "<<setprecision(9)<<fixed<<v<<endl;
  15. }
  16. }
RAW Paste Data