- #include <bits/stdc++.h>
- using namespace std;
- #define pi 3.1415926535897932
- int main(){
- int ts;
- scanf("%d", &ts);
- for(int j = 1; j <= ts; j++){
- int r1, r2, h, p;
- scanf("%d%d%d%d", &r1, &r2, &h, &p);
- double r = ((p*1.0 * (r1-r2)*1.0)/(h*1.00))*1.0 + r2*1.00;
- double x = (r2*1.0*h)/((r1-r2)*1.00);
- double ans = (pi*(r*r*1.00*(p+x)-r2*r2*1.0*x))/(3.000);
- printf("Case %d: %0.10lf\n",j, ans);
- }
- return 0;
- }
Saturday 29 July 2017
Lightoj 1216 - Juice in the Glass
Subscribe to:
Post Comments (Atom)
Most Featured Post
Lightoj 1159 - Batman
http://lightoj.com/volume_showproblem.php?problem=1159 problem analysis: First i thought of this as if s1, s2 and s3 are those three str...
-
Problem link: Problem Analysis: It is actually a basic Bisection problem , as we can see here we can not actually find a formula fo...
-
http://lightoj.com/volume_showproblem.php?problem=1382 Problem analysis: This is a rare problem i wrote about so far. After much strugg...
No comments:
Post a Comment