Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- double h1,h2,d,x;
- int t;
- scanf("%d",&t);
- while(t--)
- {
- scanf("%lf%lf%lf",&h1,&h2,&d);
- x = h1*d / (h1+h2);
- if(h1==0 && h2==0)
- {
- printf("%.4lf %.4lf\n",d/2,d/2);
- }
- else
- {
- printf("%.4lf %.4lf\n",sqrt(h1*h1+x*x),sqrt((h2*h2)+(d-x)*(d-x)));
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement