Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- // freopen("In.txt", "r", stdin);
- // freopen("Out.txt", "w", stdout);
- int i, t;
- double v1,v2,v3,a1,a2,d1,d2,d,time;
- scanf("%d", &t);
- for(i=1;i<=t;i++){
- scanf("%lf%lf%lf%lf%lf", &v1,&v2,&v3,&a1,&a2);
- d1=(v1*v1)/(2*a1);
- d2=(v2*v2)/(2*a2);
- d=d1+d2;
- time=v1/a1;
- printf("Case %d: %.8lf %.1lf\n", i,d,v3*time);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment