mhdew

Contest 4_B

Feb 15th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. // freopen("In.txt", "r", stdin);
  8. // freopen("Out.txt", "w", stdout);
  9.  
  10. int i, t;
  11. double v1,v2,v3,a1,a2,d1,d2,d,time;
  12.  
  13. scanf("%d", &t);
  14. for(i=1;i<=t;i++){
  15. scanf("%lf%lf%lf%lf%lf", &v1,&v2,&v3,&a1,&a2);
  16.  
  17. d1=(v1*v1)/(2*a1);
  18. d2=(v2*v2)/(2*a2);
  19. d=d1+d2;
  20. time=v1/a1;
  21.  
  22. printf("Case %d: %.8lf %.1lf\n", i,d,v3*time);
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment