Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- double v1,v2,v3,a1,a2,t1,t2,s1,s2,t,s,bs;
- int i,n;
- scanf("%d",&n);
- for(i=1;i<=n;i++){
- scanf("%lf %lf %lf %lf %lf",&v1,&v2,&v3,&a1,&a2);
- s1=(v1*v1)/(2*a1);
- s2=(v2*v2)/(2*a2);
- s=s1+s2;
- t1=v1/a1;
- t2=v2/a2;
- t=t1;
- if(t<t2)
- t=t2;
- bs=v3*t;
- printf("Case %d: %.9lf %.9lf\n",i,s,bs);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement