Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t, i;
- double a, b,c,r;
- scanf("%d", &t);
- double theta;
- for(i=1;i<=t;i++)
- {
- scanf("%lf %lf %lf", &a, &b, &c);
- double s = a+b*c*a;
- //if(s>a*2.0)s=a*2.0;
- double l=0;
- double h=a*a;
- for(int j=0;j<100;j++){
- r=(l+h)/2.0;
- theta = s/r;
- //printf("%lf %lf %lf \n",theta,l,h);
- double f=2*r*sin(theta/2);
- if(f>a){
- h=r;
- }
- else
- l=r;
- }
- double fi=r-r*cos(theta/2);
- printf("Case %d: %.10lf\n", i,fi );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement