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